diff --git a/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a4ba8384f67cf3bc05baeece8f7f301806556ff --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSem_0501_Identifier_001.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.1, Ensure that cannot pass a charstring value to an integer variable. + ** @verdict pass reject + *****************************************************************/ +module NegSem_0501_Identifier_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_0501_Identifier_001() runs on GeneralComp { + var integer v_i := "wrong_type"; +} + +control{ + execute(TC_NegSem_0501_Identifier_001(), 1.0); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d95aa12292af3b42643fc131ac4c3e357f2a197 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/NegSyn_0501_Identifier_001.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.1, Ensure that when the IUT loads a module containing an identifier named with a keyword then the module is rejected. + ** @verdict pass reject + *****************************************************************/ +module NegSyn_0501_Identifier_001 { + +type component GeneralComp { +} + +testcase TC_NegSyn_0501_Identifier_001() runs on GeneralComp { + var integer component := 1; +} + +control{ + execute(TC_NegSyn_0501_Identifier_001(), 1.0); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ca8424cd5e0be69f302a53fb072729b4820fd65 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0501_identifiers_and_keywords/Syn_0501_Identifier_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.1, Ensure that the IUT handle the identifiers case sensitively. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Syn_0501_Identifier_001 { + +type component IdComp { + const integer cl_int := 0; +} + +testcase TC_Syn_0501_Identifier_001() runs on IdComp { + const integer cl_iNT := 1; + if ( match(cl_int, 0) ){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Syn_0501_Identifier_001(), 1.0); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8845fabe37c46ea2552602d718c56a2be7336dd4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.2 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2.1, Ensure that the IUT correctly handles scope of formal function parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_050201_Scope_of_parameters_001 { + +type component GeneralComp { +} + +function f_formalParameterScope_in(in integer p_myParameter) { + p_myParameter := 1; + if (p_myParameter == 1){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + + +testcase TC_Sem_050201_Scope_of_parameters_001() runs on GeneralComp { + + var integer v_int := 0; + f_formalParameterScope_in(v_int); + + if (v_int == 0) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + + +control{ + execute(TC_Sem_050201_Scope_of_parameters_001()); + +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_002.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9936d1a59a8be4653de0ac07701abc38f3f81f98 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050201_Scope_of_parameters/Sem_050201_Scope_of_parameters_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2.1, Ensure that the IUT correctly handles scope of formal function parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_050201_Scope_of_parameters_002 { + +type component GeneralComp { +} + + +function f_formalParameterScope_inout(inout integer p_myParameter) { + p_myParameter := 1; +} + + + +testcase TC_Sem_050201_Scope_of_parameters_002() runs on GeneralComp { + + var integer v_int := 0; + f_formalParameterScope_inout(v_int); + + if (v_int == 1) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + + +control{ + execute(TC_Sem_050201_Scope_of_parameters_002()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..146fc16b3c035c1874470e092afa378bb03e93cd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_001 { + type component GeneralComp { + const integer cl_int := 0; + } + + testcase TC_NegSem_050202_Uniqueness_001() runs on GeneralComp { + const integer cl_int := 0; + } + control { + execute(TC_NegSem_050202_Uniqueness_001()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab53f58a9f83c8dda0bad51d5aadc6f8ce9243eb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_004.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_004 { + const integer c_int := 0; + + type component GeneralComp { + } + + function f_funcScope() {} + + testcase TC_NegSem_050202_Uniqueness_004() runs on GeneralComp { + const integer c_int := 0; + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a867fe6ec0b865ca5860bc23dba8657ee78b13ab --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_005.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_005 { + const integer c_int := 0; + + type component GeneralComp { + } + + function f_funcScope() { + const integer c_int := 0; + } + + testcase TC_NegSem_050202_Uniqueness_005() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7015a6fde48476f53540ce0af548ff412abc378 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_006.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_006 { + type component GeneralComp { + const integer repeatedIdentifier := 0; + } + + testcase TC_NegSem_050202_Uniqueness_006() runs on GeneralComp { + var boolean repeatedIdentifier := true; + } + control { + execute(TC_NegSem_050202_Uniqueness_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4561c3c02061e0c866b476f102d3134eb469dbab --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_007.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_007 { + type component GeneralComp { + const integer repeatedIdentifier := 0; + } + + function f_funcScope() runs on GeneralComp { + var boolean repeatedIdentifier := true; + } + + testcase TC_NegSem_050202_Uniqueness_007() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02717b4bd4b2220f2000be7e93638324f66c4d4a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_008.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_008 { + type component GeneralComp { + } + + function f_funcScope(boolean repeatedIdentifier) { + const integer repeatedIdentifier := 0; + } + + testcase TC_NegSem_050202_Uniqueness_008() runs on GeneralComp { + var boolean v_boolean := true; + f_funcScope(v_boolean); + } + control { + execute(TC_NegSem_050202_Uniqueness_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7ab510e942ddb014b0058481443e469b543a9b5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_009.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_009 { + const integer repeatedIdentifier := 0; + + type component GeneralComp { + } + + function f_funcScope() {} + + testcase TC_NegSem_050202_Uniqueness_009() runs on GeneralComp { + var boolean repeatedIdentifier := true; + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e758948138ad836e06434c6c104503f65d4e85b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_010.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_010 { + const integer repeatedIdentifier := 0; + + type component GeneralComp { + } + + function f_funcScope() { + var boolean repeatedIdentifier := true; + } + + testcase TC_NegSem_050202_Uniqueness_010() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_010()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..feaee1cb2b748dadc9543cbc935525fe7596a29d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_011.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ +module NegSem_050202_Uniqueness_011 { + type component GeneralComp { + } + + function f_funcScope() { + var boolean NegSem_050202_Uniqueness_011 := true; + } + + testcase TC_NegSem_050202_Uniqueness_011() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d8bf03d91c14cf42117dc0452c54b0c4dd27f40 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/NegSem_050202_Uniqueness_012.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass reject + ***************************************************/ + +module NegSem_050202_Uniqueness_012 { + import from NegSem_050202_Uniqueness_012_import { const all; } + + type component GeneralComp { + } + + function f_funcScope() { + var boolean NegSem_050202_Uniqueness_012_import := true; + } + + testcase TC_NegSem_050202_Uniqueness_012() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_NegSem_050202_Uniqueness_012()); + } +} + +module NegSem_050202_Uniqueness_012_import { + const integer c_integer := 0; +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a365a4962ff4b1cc7e308d4267f3325e51a8b0ec --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050202_Uniqueness_001 { + import from Sem_050202_Uniqueness_001_import { + const all; + } + + type component GeneralComp { + } + + function f_funcScope() { + var boolean repeatedIdentifier := true; + + if(repeatedIdentifier==true) { setverdict(pass); } + } + + testcase TC_Sem_050202_Uniqueness_001() runs on GeneralComp { + f_funcScope(); + } + control { + execute(TC_Sem_050202_Uniqueness_001()); + } +} + +module Sem_050202_Uniqueness_001_import { + const integer repeatedIdentifier := 0; // repeated indentifier from imported module is allowed +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa6ce5105055b4cddfa7dbdf3880fe059395df28 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_002.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_050202_Uniqueness_002 { + type component GeneralComp { + const integer cl_int := 0; + } + + function f_funcScope() { + const integer cl_int := 1; + } + + testcase TC_Sem_050202_Uniqueness_002() runs on GeneralComp { + f_funcScope(); + if (cl_int == 0) { // component value + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_050202_Uniqueness_002()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60f4fa59be4d6310f523351f7816b31bc2c0aa15 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_003.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that the IUT correctly handles the uniqueness of variable names in its scope + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_050202_Uniqueness_003 { + type component GeneralComp { + } + + function f_funcScope() { + const integer cl_int := 0; + } + + testcase TC_Sem_050202_Uniqueness_003() runs on GeneralComp { + const integer cl_int := 1; + f_funcScope(); + if (cl_int == 1) { // local value + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_050202_Uniqueness_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_004.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94db5151ff5f59a1eaa77ceed110f574f7437bbc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that identifiers for fields of structured types, enumerated values and groups do not have to be globally unique. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* The following requirements are tested: + * Within the same module,they shall only be reused for enumerated values within other enumerated types or as identifiers for fields of structured types. In addition, enumeration values shall not be used as names of value or + * template definitions of imported enumeration types, defining the given enumeration value + */ + +module Sem_050202_Uniqueness_004 { + type component GeneralComp { + } + type enumerated MyFirstEnumType {MyFirstEnumValue,MySecondEnumValue}; + type enumerated MySecondEnumType{MyFirstEnumValue,MySecondEnumValue}; //enumerated values within other enumerated types or as identifiers for fields of structured types + + testcase TC_Sem_050202_Uniqueness_004() runs on GeneralComp { + + var MyFirstEnumType v_enum := MySecondEnumValue; + var MySecondEnumType v_enum_2 := MySecondEnumValue; + + if (match(v_enum,MySecondEnumValue) and match(v_enum_2,MySecondEnumValue)) { // local value + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_050202_Uniqueness_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_005.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be21620421506b87a6901e6a7011229bf826723b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/050202_Uniqueness_of_identifiers/Sem_050202_Uniqueness_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.2.2, Ensure that identifiers for fields of structured types, enumerated values and groups do not have to be globally unique. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the same module,they shall only be reused for enumerated values within other enumerated types or as identifiers for fields of structured types. In addition, enumeration values shall not be used as names of value or + * template definitions of imported enumeration types, defining the given enumeration value + */ + +module Sem_050202_Uniqueness_005 { + type component GeneralComp { + } + + type enumerated MyFirstEnumType {MyInt,MySecondEnumValue}; + + type record MyRec { + integer Myint + } + + testcase TC_Sem_050202_Uniqueness_005() runs on GeneralComp { + + var MyFirstEnumType v_enum := MySecondEnumValue; + var MyRec v_rec; + + v_rec.Myint := 1; + + if (match(v_enum,MySecondEnumValue) and match(v_rec.Myint,1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_050202_Uniqueness_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..121454fd889d659d37ed9bb26a17190c26578652 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2, Ensure that the IUT correctly handles definitions of local scope + ** @verdict pass reject + ***************************************************/ +module NegSem_0502_Scope_001 { + +type component GeneralComp { + var integer vc_component := 0; +} + +function f_funcScope() runs on GeneralComp { + var integer v_function := 0; +} + +testcase TC_NegSem_0502_Scope_001() runs on GeneralComp { + f_funcScope(); + if ( match(v_function, 0) ){ + } +} + +control{ + var integer v_control := 0; + execute(TC_NegSem_0502_Scope_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40c3e9470b79fafc67a4832b8f606acae0908b82 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2, Ensure that the IUT correctly handles definitions of local scope + ** @verdict pass reject + ***************************************************/ +module NegSem_0502_Scope_002 { + +type component GeneralComp { + var integer vc_component := 0; +} + +function f_funcScope() runs on GeneralComp { + var integer v_function := 1; +} + +testcase TC_NegSem_0502_Scope_002() runs on GeneralComp { + if ( match(v_control, 0) ){ + } +} + +control{ + var integer v_control := 0; + execute(TC_NegSem_0502_Scope_002()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_003.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12efe1b6ac8db5f6713a85863672ca8fe2076d48 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/NegSem_0502_Scope_003.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2, Ensure that the IUT correctly handles definitions of local scope + ** @verdict pass reject + ***************************************************/ +module NegSem_0502_Scope_003 { + +type component GeneralComp { + var integer vc_component := 0; +} + +function f_funcScope() runs on GeneralComp { + var integer v_function := 0; +} + +testcase TC_NegSem_0502_Scope_003() runs on GeneralComp { + if(true) { + var integer v_statement := 0; + } + if ( match(v_statement, 0) ) { + } +} + +control{ + var integer v_control := 0; + execute(TC_NegSem_0502_Scope_003()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..198e39eec9af2a8d84639d26a1eb17826751d6b0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2, Ensure that the IUT handle scope hieararchy of component constants. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0502_Scope_001 { + +type component GeneralComp { + const integer cl_int := 0; +} + +testcase TC_Sem_0502_Scope_001() runs on GeneralComp { + if ( match(cl_int, 0) ){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_001()); +} +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2605f586f94979449bf1bb96c4bf171e9ae36121 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2, Ensure that the IUT handle scope hieararchy with component booleans. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0502_Scope_002 { + +type component GeneralComp { + var boolean vc_bool := false; +} + +testcase TC_Sem_0502_Scope_002_a() runs on GeneralComp { + if (vc_bool == false){ + vc_bool := true; + setverdict(pass); + } + else { + setverdict(fail); + } +} +/********************************************************************************************* + ** @desc Test case TC_Sem_0502_Scope_002_a shall not effect of the value of boolean vc_bool + ********************************************************************************************/ +testcase TC_Sem_0502_Scope_002_b() runs on GeneralComp { + if (vc_bool == false){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_002_a()); + execute(TC_Sem_0502_Scope_002_b()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d8a8269a06c3fa4480275559c251c34e46190cd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_003.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2, Ensure that the IUT handles scope hierarchy via functions. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0502_Scope_003 { + +type component GeneralComp { + var integer vc_int := 0; +} + +function f_funcScope() runs on GeneralComp { + vc_int := 1; + if (vc_int == 1){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +testcase TC_Sem_0502_Scope_003_a() runs on GeneralComp { + f_funcScope(); +} + +testcase TC_Sem_0502_Scope_003_b() runs on GeneralComp { + f_funcScope(); + if (vc_int == 1){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_003_a()); + execute(TC_Sem_0502_Scope_003_b()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8aa9fe1253aaaa585b790259e13a99c28464dc7b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_004.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2, Ensure that the IUT correctly handles the scope of definitions made in the module part. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0502_Scope_004 { + + const integer c_int := 0; + +type component GeneralComp { +} + +testcase TC_Sem_0502_Scope_004() runs on GeneralComp { + if (c_int == 0){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_004()); +} +} + + +module Sem_0502_Scope_004_import { + +import from Sem_0502_Scope_004 { + const all +} + +type component GeneralComp { +} + +testcase TC_Sem_0502_Scope_004_import() runs on GeneralComp { + if (c_int == 0){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_004_import()); +} +} + + diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..624ca8d926b7d48d3f74b4dafd69702e966597d1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Sem_0502_Scope_008.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.2, Ensure that the IUT correctly handles definitions of extended component scope + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0502_Scope_008 { + +type component GeneralComp { + var integer vc_component := 1; +} + +type component ExtendedComp extends GeneralComp { +} + + +testcase TC_Sem_0502_Scope_008() runs on ExtendedComp { + if (vc_component == 1) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0502_Scope_008()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b895d8e9fe8eb7965c68cbd2ef0c5949e8ec5d3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0502_scope_rules/0502_toplevel/Syn_0502_Scope_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.2, Ensure that the IUT supports all the nine scope units. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Syn_0502_Scope_001 { + +const integer c_intModule := 0; // scope a) module definitions part +type integer IntegerMod; + +type component GeneralComp { + const integer cl_int := 0; + var integer vc_int := 0; + var boolean vc_bool := false; + timer tc_timer := 0.1; // scope c) component types +} + +testcase TC_Syn_0502_Scope_001() runs on GeneralComp { // scope f) test cases + f_funcScope(); + tc_timer.start; + a_altstepScope(); + if (c_intModule == 0){ + setverdict(pass); + } + else { + setverdict(fail); + } + if (cl_int == 0){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +group recordGroup { // scope g) statement block + type record RecScope { // scope i) user defined named types + IntegerMod field1, + boolean field2 + } +} + +group templateGroup { + template RecScope m_scope := { // scope h) templates + field1 := 0, + field2 := true + } +} + +function f_funcScope() runs on GeneralComp { + vc_int := 1; // scope d) functions + if (vc_int == 1){ + setverdict(pass); + } + else { + setverdict(fail); + } +} + +altstep a_altstepScope() runs on GeneralComp { + var integer v_intAltStep := 2; // scope e) altsteps + []tc_timer.timeout{ + if (v_intAltStep == 2) { + setverdict(pass); + } else { + setverdict(fail) + } + } +} + + +control{ + var integer v_intControl := 0; // scope b) control part of a module + + execute(TC_Syn_0502_Scope_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14b13b73c17b4eb1d7b32f299a2da295fc23cc54 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 409 + ** @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 reject + ***************************************************/ +module NegSem_0503_Ordering_001 { + + type component GeneralComp { + var integer vc_component := 0; + } + + function f_function() runs on GeneralComp { + var integer v_function := 0; + } + + testcase TC_NegSem_0503_Ordering_001() runs on GeneralComp { + if(true) { + var integer v_statement := 0; + if (v_nested_statement == 0) { // attempt to access a variable defined in the next scope + var integer v_nested_statement := 0; + } + + } + } + + control { + var integer v_control := 0; + execute(TC_NegSem_0503_Ordering_001()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_002.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ae3d84447f78c66b13ff9e958b81f18086994fd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_002.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @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 reject + ***************************************************/ +module NegSem_0503_Ordering_002 { + + type component GeneralComp { + var integer vc_component := 0; + } + + function f_function() runs on GeneralComp { + var integer v_function := 0; + } + + testcase TC_NegSem_0503_Ordering_002() 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 has to go before other statements + } + + } + setverdict(pass); + } + + control { + var integer v_control := 0; + execute(TC_NegSem_0503_Ordering_002()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_003.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7287643118661e6d26511b79b172be8cc2818751 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/NegSem_0503_Ordering_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @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 reject + ***************************************************/ +module NegSem_0503_Ordering_003 { + + 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 has to go before other statements + } + + testcase TC_NegSem_0503_Ordering_003() 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_NegSem_0503_Ordering_003()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00276814280381d7889c60ddb9976fd6bdb249d8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.3, Ensure that allowed orderings of declarations are supported + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0503_Ordering_001 { + +type component GeneralComp { + var integer vc_component := 0; +} + +testcase TC_Sem_0503_Ordering_001() runs on GeneralComp { + var integer v_testcase := 0; + + f_function(); + if(true) { + var integer v_statement := 0; + if (v_statement == 0) { + var integer v_nested_statement := 0; + setverdict(pass); + } + + } +} + +function f_function() runs on GeneralComp { + var integer v_function := 0; +} + +control { + var integer v_control := 0; + execute(TC_Sem_0503_Ordering_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_002.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58769e8fb990531ce69162dac44b85a062cc8e5e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @desc Test cases for clause 5.3 ordering rules + ** @purpose 1:5.3, Ensure that allowed any ordering with component definitions are supported + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0503_Ordering_002 { + + + type port loopbackPort message { + inout integer + } + +type component GeneralComp //declarations inside a component can be in any order +{ + timer t_rec,t_rec2; + var integer v_comp1:=0; + port loopbackPort messagePortA; + var integer v_comp2:=0; +} + +testcase TC_Sem_0503_Ordering_002() runs on GeneralComp { + + v_comp1 := 1; + v_comp2 := v_comp1; + if (v_comp2 == 1) { + setverdict(pass); + } + +} + +control { + execute(TC_Sem_0503_Ordering_002()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e0c2ed5ece17180bdc52d3e1058d4f1901763817 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @desc Test cases for clause 5.2 Scope rules + ** @purpose 1:5.3, Ensure that allowed orderings of declarations are supported + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0503_Ordering_005 { + +type component GeneralComp { + var integer vc_component := 0; +} + +testcase TC_Sem_0503_Ordering_005() runs on GeneralComp { + var integer v_testcase := 0; + + f_function(); + if(true) { + var integer v_statement := 0; + if (c_module == 0) { // c_module is known as it is declared on the module level + var integer v_nested_statement := 0; + setverdict(pass); + } + + } +} + +function f_function() runs on GeneralComp { + var integer v_function := 0; +} + + const integer c_module := 0; + +control { + var integer v_control := 0; + execute(TC_Sem_0503_Ordering_005()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2623779c52802814b287b9a3f3056f3410cd83fd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of template cannot used dash as default value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Formal parameters of modified templates may inherit the default values from the corresponding +// parameters of their parent templates; this shall explicitly be denoted by using a dash (don't +// change) symbol at the place of the modified template parameters' default value. + +module NegSem_05040101_parameters_of_kind_value_001 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(integer p_int1 := 3, in integer p_int2 := -) := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..063946f1642cda0a2c78448f846bbd41a9f763f3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that modified template cannot used dash as default value when original value parameter had no default value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Formal parameters of modified templates may inherit the default values from the corresponding +// parameters of their parent templates; this shall explicitly be denoted by using a dash (don't +// change) symbol at the place of the modified template parameters' default value. + +module NegSem_05040101_parameters_of_kind_value_002 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(integer p_int1, in integer p_int2 := 4) := { + field1 := p_int1, + field2 := p_int2 + } + + template R m_tmod(integer p_int1 := -, in integer p_int2 := 6) modifies m_t := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2254a6909bf5d523f9827c76ffbb13d72f7569d6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that template definitions cannot contain out value formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// Formal value parameters of templates ... shall always be in parameters. + +module NegSem_05040101_parameters_of_kind_value_003 { + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(out integer p_int) return integer { + p_int := 2; + return p_int; + } + + template R m_t(out integer p_int) := { + field1 := 0, + field2 := f(p_int) + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_003() runs on GeneralComp { + var integer v_int; + log(m_t(v_int)); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d79604a5479fc4a0f69a884de8d0e16c5b9bc0ea --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that template definitions cannot contain inout value formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// Formal value parameters of templates ... shall always be in parameters. + +module NegSem_05040101_parameters_of_kind_value_004 { + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(inout integer p_int) return integer { + p_int := p_int * 2; + return p_int; + } + + template R m_t(inout integer p_int) := { + field1 := 0, + field2 := f(p_int) + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_004() runs on GeneralComp { + var integer v_int := 1; + log(m_t(v_int)); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d3ec00d702659f38619fa1aec08d4722ced75c0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_005.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that out value formal parameters cannot have default values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction d) +// Default values can be provided for in parameters only. + +module NegSem_05040101_parameters_of_kind_value_005 { + type component GeneralComp { + } + + function f(out integer p_int := 5) { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_005() runs on GeneralComp { + var integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00c5ea721ec1d00a0d2a81120fe4fbf8e6bb74bc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_006.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that inout value formal parameters cannot have default values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction d) +// Default values can be provided for in parameters only. + +module NegSem_05040101_parameters_of_kind_value_006 { + type component GeneralComp { + } + + function f(inout integer p_int := 5) { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_006() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b9e8086f8d33724a3558f0d720345dfc04f4e41 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_007.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that incompatible value in default value assignment of value formal parameters causes error + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The expression of the formal parameters' default value has to be compatible with the type of the parameter. + +module NegSem_05040101_parameters_of_kind_value_007 { + type component GeneralComp { + } + + function f(in integer p_int := 5.0) { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_007() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6125916a485204822c924ee9402b367c2af24acb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_009.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot reference other parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The expression shall not refer to other parameters of the same parameter list. + +module NegSem_05040101_parameters_of_kind_value_009 { + type component GeneralComp { + } + + function f(in integer p_int, in integer p_int2 := p_int) runs on GeneralComp { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_009() runs on GeneralComp { + f(2); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4e780e73fb4f26a437ea404725c3c7adc3ec3ae --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_011.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that error is generated if formal value parameter of function contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040101_parameters_of_kind_value_011 { + + type component GeneralComp { + } + + function f (integer p_int := -) { + log(p_int); + } + + testcase TC_NegSem_05040102_parameters_of_kind_value_011() runs on GeneralComp { + f(1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_value_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b364406aaba71be7823cc4fcaa87b2dc84a22365 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_012.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that error is generated if formal value parameter of altstep contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040101_parameters_of_kind_value_012 { + + type component GeneralComp { + } + + altstep a(integer p_int := -) { + []any timer.timeout {} + [else] {} + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_012() runs on GeneralComp { + a(1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_012()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..804ae68f3a62717fe47bbea143a6da6804656154 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_013.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that error is generated if formal value parameter of test case contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040101_parameters_of_kind_value_013 { + + type component GeneralComp { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_013(integer p_int := -) runs on GeneralComp { + log(p_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_013(1)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a510628ff449f19f1a26da688d4012ddfe21b1e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_014.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that out formal value parameters cannot have lazy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j) +// Only in parameters can be declared lazy or fuzzy. + +module NegSem_05040101_parameters_of_kind_value_014 { + + type component GeneralComp { + } + + function f(out @lazy integer p_int) { + p_int := 6; + } + testcase TC_NegSem_05040101_parameters_of_kind_value_014() runs on GeneralComp { + var integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_014()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e9eee4eb0cd19e1083ec249533019522e1ceb08 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_015.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that out formal value parameters cannot have fuzzy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j) +// Only in parameters can be declared lazy or fuzzy. + +module NegSem_05040101_parameters_of_kind_value_015 { + + type component GeneralComp { + } + + function f(out @fuzzy integer p_int) { + p_int := 6; + } + testcase TC_NegSem_05040101_parameters_of_kind_value_015() runs on GeneralComp { + var integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..559f11d54a11b1e044c07ab4a42b8612971fc778 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_016.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that inout formal value parameters cannot have lazy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j) +// Only in parameters can be declared lazy or fuzzy. + +module NegSem_05040101_parameters_of_kind_value_016 { + + type component GeneralComp { + } + + function f(inout @lazy integer p_int) { + p_int := 6; + } + testcase TC_NegSem_05040101_parameters_of_kind_value_016() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_016()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b2b94cd1ccdbb68dfb708c4d78a32c943b263a8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_017.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that inout formal value parameters cannot have fuzzy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction j) +// Only in parameters can be declared lazy or fuzzy. + +module NegSem_05040101_parameters_of_kind_value_017 { + + type component GeneralComp { + } + + function f(inout @fuzzy integer p_int) { + p_int := 6; + } + testcase TC_NegSem_05040101_parameters_of_kind_value_017() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a39234b34da0309a49ce1b9102ccfe893b274a6a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_018.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that incompatible value in default value assignment of value formal parameters causes error + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The expression of the formal parameters' default value had to be compatible with the type of the parameter. + +module NegSem_05040101_parameters_of_kind_value_007 { + type component GeneralComp { + } + + function f(in integer p_int := 5.0) { + } + + testcase TC_NegSem_05040101_parameters_of_kind_value_007() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_value_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f98d073559286a1048409a3591136294ca706da --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_001.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that const definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_001 { + + const integer c_int(integer p_int) := p_int + 2; +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd44bda40864574b5f8ba6db71be6ba95f1a9f54 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_002.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that var definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_002 { + + function f() { + var integer c_int(integer p_int) := p_int + 2; + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c53fd186a1430d09dc034e8c2acf9e9a5e4ffa4b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_003.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that template variable definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_003 { + + function f() { + var template integer c_int(integer p_int) := p_int + 2; + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f4044c216e207ea8b363f1a3aa0bb5cf8f6c5e1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_004.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that timer definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_004 { + + function f() { + timer t_timer(float p_float) := p_float * 2; + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce023afa0e5f563dd99b321439a19918d068f2df --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_005.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that control definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_005 { + + control(integer p_int) { + log(p_int); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b9eff598ffb48c42176ac582caad649cfcc581e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_006.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that record of definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_006 { + + type record of integer RoI (integer p_int); +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8e15e6c0b70af9e8aab904bebe495d2130081d3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_007.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that set of definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_007 { + + type set of integer SoI (integer p_int); +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b2efb9d2e071a0025874f75809514aca343b799 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_008.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that enumerated definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_008 { + + type enumerated EColour(integer p_int) { red, blue, green } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4c3e0b61759e027a3d1c8bcbb1689ca7e2ea6d3b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_009.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that port definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_009 { + + type port P(integer p_int) message { + inout integer; + map param(integer p_par := p_int); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03e6b5aa65bcce2a982cf0c6c8a4434d77480d6c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_010.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that component definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_010 { + + type component C (integer p_int) { + var integer v_int := p_int; + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c028119b2f8e9300f51dd6a534dd570e6b9c9344 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_011.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that subtype definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_010 { + + type integer MyInt(integer p_int); +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c476ae12b8298a4c3e4004c1335930a7ab5d53c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_012.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that group definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_011 { + + group Group1 (integer p_int) { + const integer c_int := 2 * p_int; + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd44d1709101e8482ab3ddee8e4db6e5ce60eeb0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSyn_05040101_parameters_of_kind_value_013.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that import definition cannot be parameterized + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Language elements which cannot be parameterized are: const, var, timer, control, record of, +// set of, enumerated, port, component and subtype definitions, group and import. + +module NegSyn_05040101_parameters_of_kind_value_013 { + + import from Sem_05040101_parameters_of_kind_value_001 (integer INTEGER_MODULE_PARAMETER) all; +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40a8a0a4fd81342293c5bb4909847eb8d6713b8a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.2 + ** @purpose 1:5.4.1.1, Ensure that the IUT correctly handles parametrization through the use of module parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040101_parameters_of_kind_value_001 { + + // the following module parameters must not be set externally, as their default values are being checked + modulepar integer INTEGER_MODULE_PARAMETER := 1; + + + type component GeneralComp { + } + + + testcase TC_Sem_05040101_parameters_of_kind_value_001() runs on GeneralComp { + if ( (INTEGER_MODULE_PARAMETER == 1)) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_001()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c24f6c22c22c7a6185a60e042c04e8a8fb161006 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Ensure that the IUT correctly handles parametrization through the use of module parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040101_parameters_of_kind_value_002 { + + // the following module parameters must not be set externally, as their default values are being checked + modulepar boolean BOOLEAN_MODULE_PARAMETER := true; + + + type component GeneralComp { + } + + + testcase TC_Sem_05040101_parameters_of_kind_value_002() runs on GeneralComp { + if ( BOOLEAN_MODULE_PARAMETER == true){ + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_002()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a49184c144fbab662b8f865293961a61d0ab393 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Ensure that the IUT correctly handles parametrization through the use of module parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040101_parameters_of_kind_value_003 { + + // the following module parameters must not be set externally, as their default values are being checked + modulepar address ADDRESS_MODULE_PARAMETER := 5; + + type integer address; + + type component GeneralComp { + } + + + testcase TC_Sem_05040101_parameters_of_kind_value_003() runs on GeneralComp { + if ( ADDRESS_MODULE_PARAMETER == 5) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_003()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0392ea8b37c70c90e4ed873b928f87ca6f04d8dd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_004.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, Ensure that the IUT correctly handles parametrization through the use of module parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040101_parameters_of_kind_value_004 { + + // the following module parameter must not be set externally, as their default values are being checked + + modulepar MyEnumeratedType ENUMERATED_MODULE_PARAMETER := e_black; + + type enumerated MyEnumeratedType {e_black, e_white} + + type component GeneralComp { + } + + + testcase TC_Sem_05040101_parameters_of_kind_value_004() runs on GeneralComp { + if (ENUMERATED_MODULE_PARAMETER == e_black ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_004()); + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca89cc9828ab58930de3dc9b6285cecda2b65ded --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_005.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that template definition can contain in value formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports value parameterization according to the following rules: +// - the language elements template, testcase, altstep and function support dynamic value +// parameterization (i.e. this parameterization shall be resolved at runtime). Value formal +// parameters may be in, inout or out parameters. The default for value formal parameters is +// in parameterization which may optionally be denoted by the keyword in. Using of inout or out +// kind of parameterization shall be specified by the keywords inout or out respectively. + +module Sem_05040101_parameters_of_kind_value_005 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(integer p_int1, in integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040101_parameters_of_kind_value_005() runs on GeneralComp { + log(m_t(3,4)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7db29048f8beab9c245a0dab726f609b67519e05 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_006.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that local template definition can contain in value formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports value parameterization according to the following rules: +// - the language elements template, testcase, altstep and function support dynamic value +// parameterization (i.e. this parameterization shall be resolved at runtime). Value formal +// parameters may be in, inout or out parameters. The default for value formal parameters is +// in parameterization which may optionally be denoted by the keyword in. Using of inout or out +// kind of parameterization shall be specified by the keywords inout or out respectively. + +module Sem_05040101_parameters_of_kind_value_006 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + testcase TC_Sem_05040101_parameters_of_kind_value_006() runs on GeneralComp { + template R m_t(integer p_int1, in integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3,4)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab9e386f3324d8000308fdc7cd0bf305f8ba4dd9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that function definition can contain in, out and inout value formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports value parameterization according to the following rules: +// - the language elements template, testcase, altstep and function support dynamic value +// parameterization (i.e. this parameterization shall be resolved at runtime). Value formal +// parameters may be in, inout or out parameters. The default for value formal parameters is +// in parameterization which may optionally be denoted by the keyword in. Using of inout or out +// kind of parameterization shall be specified by the keywords inout or out respectively. + +module Sem_05040101_parameters_of_kind_value_007 { + + type component GeneralComp { + } + + function f(integer p_int1, in integer p_int2, out integer p_int3, inout integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_007() runs on GeneralComp { + var integer v_int1, v_int2 := 0; + f(1, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5bf7ddebe942324a012760bbd352a3d48b99dd6d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_008.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that altstep definition can contain in, out and inout value formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports value parameterization according to the following rules: +// - the language elements template, testcase, altstep and function support dynamic value +// parameterization (i.e. this parameterization shall be resolved at runtime). Value formal +// parameters may be in, inout or out parameters. The default for value formal parameters is +// in parameterization which may optionally be denoted by the keyword in. Using of inout or out +// kind of parameterization shall be specified by the keywords inout or out respectively. + +module Sem_05040101_parameters_of_kind_value_008 { + + type component GeneralComp { + } + + altstep a(integer p_int1, in integer p_int2, out integer p_int3, inout integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040101_parameters_of_kind_value_008() runs on GeneralComp { + var integer v_int1, v_int2 := 0; + a(1, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37d854ee177a10e049dae575da8d69cc0bb183b8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_009.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that test case definition can contain in, out and inout value formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports value parameterization according to the following rules: +// - the language elements template, testcase, altstep and function support dynamic value +// parameterization (i.e. this parameterization shall be resolved at runtime). Value formal +// parameters may be in, inout or out parameters. The default for value formal parameters is +// in parameterization which may optionally be denoted by the keyword in. Using of inout or out +// kind of parameterization shall be specified by the keywords inout or out respectively. + +module Sem_05040101_parameters_of_kind_value_009 { + + type component GeneralComp { + } + + testcase TC_Sem_05040101_parameters_of_kind_value_009(integer p_int1, in integer p_int2, out integer p_int3, inout integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var integer v_int1, v_int2 := 0; + execute(TC_Sem_05040101_parameters_of_kind_value_009(1, 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f68e184368a497471719adc6ac7fa9ac77ca896 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_010.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that value formal parameters can be used in expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Value formal parameters can be used within the parameterized object the same way as values, +// for example in expressions. + +module Sem_05040101_parameters_of_kind_value_010 { + + type component GeneralComp { + } + + function f(integer p_int1, in integer p_int2){ + if (p_int1 + p_int2 == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_05040101_parameters_of_kind_value_010() runs on GeneralComp { + f(2, 3); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_010()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cce3e2b66f7d0b9bb63e517b300a0ea6c62602c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_011.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of template can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default value, which is given by an expression assigned to +// the parameter. + +module Sem_05040101_parameters_of_kind_value_011 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(integer p_int1 := 3, in integer p_int2 := 4) := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9041a39c5835221c4e63a5b8a0333b9961841c38 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_012.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of local template can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default value, which is given by an expression assigned to +// the parameter. + +module Sem_05040101_parameters_of_kind_value_012 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f() { + template R m_t(integer p_int1 := 3, in integer p_int2 := 4) := { + field1 := p_int1, + field2 := p_int2 + } + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ee5a534728167e8f87bce4125ec96941ee1ceea --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_013.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of function can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default value, which is given by an expression assigned to +// the parameter. + +module Sem_05040101_parameters_of_kind_value_013 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(integer p_int1 := 3, in integer p_int2 := 4) { + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbf60dfb8b7bf6d192b7c3b5c5e4705c030ae8cc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_014.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of altstep can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default value, which is given by an expression assigned to +// the parameter. + +module Sem_05040101_parameters_of_kind_value_014 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + altstep a(integer p_int1 := 3, in integer p_int2 := 4) { + [] any timer.timeout {} + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9eb462980260aa193f9a2f9031bcc551bc9051ed --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_015.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of test case can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default value, which is given by an expression assigned to +// the parameter. + +module Sem_05040101_parameters_of_kind_value_015 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + testcase TC(integer p_int1 := 3, in integer p_int2 := 4) runs on GeneralComp { + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8f4e0498cb9f8ba1ebe7c60c532a6877be8d3b7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_016.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that in value formal parameters of modified template can used dash as default value + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Formal parameters of modified templates may inherit the default values from the corresponding +// parameters of their parent templates; this shall explicitly be denoted by using a dash (don't +// change) symbol at the place of the modified template parameters' default value. + +module Sem_05040101_parameters_of_kind_value_016 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(integer p_int1 := 3, in integer p_int2 := 4) := { + field1 := p_int1, + field2 := p_int2 + } + + template R m_tmod(integer p_int1 := 10, in integer p_int2 := -) modifies m_t := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2bfb06048c994320ac7ff3aec4490eab8eb826d7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_017.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that null is suitable default value of formal value parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Default values of component type formal parameters shall be one of the special values null, +// mtc, self, or system. + +module Sem_05040101_parameters_of_kind_value_017 { + + type component GeneralComp { + } + + function f(GeneralComp p_comp := null) { + log(p_comp); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_017() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..224bf3d6ceff026baca0cfa3552e086fe159e290 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_018.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that self is suitable default value of formal value parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Default values of component type formal parameters shall be one of the special values null, +// mtc, self, or system. + +module Sem_05040101_parameters_of_kind_value_018 { + + type component GeneralComp { + } + + function f(GeneralComp p_comp := self) { + log(p_comp); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_018() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_018()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3ea319dc72e6c4c9369b3f6a99f373bc3223d68 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_019.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that mtc is suitable default value of formal value parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Default values of component type formal parameters shall be one of the special values null, +// mtc, self, or system. + +module Sem_05040101_parameters_of_kind_value_019 { + + type component GeneralComp { + } + + function f(GeneralComp p_comp := mtc) { + log(p_comp); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_019() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_019()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_020.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20b822e0ca483c7a41e0597050805e07c00e5095 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_020.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that system is suitable default value of formal value parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Default values of component type formal parameters shall be one of the special values null, +// mtc, self, or system. + +module Sem_05040101_parameters_of_kind_value_020 { + + type component GeneralComp { + } + + function f(GeneralComp p_comp := system) { + log(p_comp); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_020() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_020()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_021.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..686ce1c2a68fbfb2713f5f24d107e3947866b928 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_021.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that null can be used as default value of formal value parameters of default type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// Default values of default type formal parameters shall be the special value null. + +module Sem_05040101_parameters_of_kind_value_021 { + + type component GeneralComp { + } + + function f(default p_def := null) { + log(p_def); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_021() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_021()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_022.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25044a5bba9f4726b93f1face1ff814abc01c35f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_022.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that passing by value and by reference works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// No specific requirement, just (slightly modified) example 6 + +module Sem_05040101_parameters_of_kind_value_022 { + + type component GeneralComp { + } + + function f_byValue (in integer p_int1, in integer p_int2) { + p_int2 := p_int2 + 1; + log(p_int1); + log(p_int2); + } + + function f_byReference (inout integer p_int1, inout integer p_int2) { + p_int2 := p_int2 + 1; + log(p_int1); + log(p_int2); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_022() runs on GeneralComp { + var integer v_int := 1; + f_byValue(v_int, v_int); // prints 1 and 2 + log(v_int); // prints 1 + if (v_int == 1) { setverdict(pass); } + else { setverdict(fail); } + f_byReference(v_int, v_int); // prints 2 and 2 + log(v_int); // prints 2 + if (v_int == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_022()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_023.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04e5a4e2f6c387b4622b1bca3892339f0a168ce4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_023.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.2 + ** @purpose 1:5.4.1.1, verify that the default value of value formal parameters can reference component variables + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Background: +// Prior to the version TTCN-3:2017, the restriction 5.4.1.1.e didn't allow to refer to elements of the component type +// of the optional runs on clause in the default value expression. + +module Sem_05040101_parameters_of_kind_value_023 { + type component GeneralComp { + var integer vc_int := 0; + } + + function f(in integer p_int := vc_int) runs on GeneralComp { + } + + testcase TC_Sem_05040101_parameters_of_kind_value_023() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_023()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_024.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8db1d35d6efb5029b3c6e14f346ee365ec18ca37 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_024.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.2 + ** @purpose 1:5.4.1.1, verify that default value of value formal parameters can invoke functions with runs on clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Background: +// Prior to the version TTCN-3:2017, the expression could not contain the invocation of functions with a runs on clause. + +module Sem_05040101_parameters_of_kind_value_024 { + type component GeneralComp { + var integer vc_int := 1; + } + + 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_Sem_05040101_parameters_of_kind_value_024() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_024()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_025.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33268cdb507a1999dcf9af12a220788b848499b5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_parameters_of_kind_value_025.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:5.4.1.1, verify that default values are evaluated in the scope of the parameterized entity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e +// The [default value] expression may be any expression that is well-defined at the beginning of the scope +// of the parameterized entity + +module Sem_05040101_parameters_of_kind_value_025 { + type component GeneralComp { + var integer vc_int := 1; + } + + function f(in integer p_int := vc_int) runs on GeneralComp { + log(p_int); + if (p_int == vc_int) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_05040101_parameters_of_kind_value_025() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + vc_int := 100; + v_ptc.start(f()); // p_int defaults to 1 (vc_int of v_ptc) and not to 100 (vc_int of self) + v_ptc.done; + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_025()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2fee89b9737ed747189354c1a27d871604668f8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of template cannot used dash as default value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters of modified templates may inherit their default templates from the +// corresponding parameters of their parent templates; this shall explicitly be denoted by using +// a dash (don't change) symbol at the place of the modified template parameter's default template. + +module NegSem_05040102_parameters_of_kind_template_001 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R mw_t(template integer p_int1 := ?, in template integer p_int2 := -) := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0cdd1323db172cf20f6584ea196ea4023dd14df --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that modified template cannot used dash as default value when original template parameter had no default value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters of modified templates may inherit their default templates from the +// corresponding parameters of their parent templates; this shall explicitly be denoted by using +// a dash (don't change) symbol at the place of the modified template parameter's default template. + +module NegSem_05040102_parameters_of_kind_template_002 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R m_t(template integer p_int1, in template integer p_int2 := 4) := { + field1 := p_int1, + field2 := p_int2 + } + + template R m_tmod(template integer p_int1 := -, in template integer p_int2 := ?) modifies m_t := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ba851115bffb6fefea7b8abb64576bda19c3612 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definitions cannot contain out template formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// Formal template parameters of templates ... shall always be in parameters. + +module NegSem_05040101_parameters_of_kind_template_003 { + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(out template integer p_int) return template integer { + p_int := ?; + return p_int; + } + + template R m_t(out template integer p_int) := { + field1 := 0, + field2 := f(p_int) + } + + testcase TC_NegSem_05040101_parameters_of_kind_template_003() runs on GeneralComp { + var template integer v_int; + log(m_t(v_int)); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040101_parameters_of_kind_template_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d55bf337c9c13cd26e900fc1f6dd422a7a7e7f7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definitions cannot contain inout template formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// Formal value parameters of templates ... shall always be in parameters. + +module NegSem_05040102_parameters_of_kind_template_004 { + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(inout template integer p_int) return template integer { + p_int := ?; + return p_int; + } + + template R m_t(inout template integer p_int) := { + field1 := 0, + field2 := f(p_int) + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_004() runs on GeneralComp { + var template integer v_int := 1; + log(m_t(v_int)); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..934a2c70ce67518c56c21c754c5014c388739bb8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_005.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that out template formal parameters cannot have default values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction c) +// Default templates can be provided for in parameters only. + +module NegSem_05040102_parameters_of_kind_template_005 { + type component GeneralComp { + } + + function f(out template integer p_int := ?) { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_005() runs on GeneralComp { + var template integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a448c690f47803a0ed0b966a3626056ac80b9df --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_006.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that inout template formal parameters cannot have default values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction c) +// Default templates can be provided for in parameters only. + +module NegSem_05040102_parameters_of_kind_template_006 { + type component GeneralComp { + } + + function f(inout template integer p_int := ?) { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_006() runs on GeneralComp { + var template integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..943edb6c07faabd27ba26406109a5cb8ac1018e2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_007.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that incompatible template instance in default template assignment of template formal parameters causes error + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction d) +// The default template instance has to be compatible with the type of the parameter. + +module NegSem_05040102_parameters_of_kind_template_007 { + type component GeneralComp { + } + + function f(in template integer p_int := (-infinity..5.0)) { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_007() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fcf2aa7b7348b70e841fd042191e22d8d55e18d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_009.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters cannot reference other parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// The template instance shall not refer to other parameters in the same parameter list. + +module NegSem_05040102_parameters_of_kind_template_009 { + type component GeneralComp { + } + + function f(in template integer p_int, in template integer p_int2 := p_int) runs on GeneralComp { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_009() runs on GeneralComp { + f(?); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2862771d926596cc63f9b63ea6f4f50627e8e03f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_011.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that error is generated if formal template parameter of function contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040102_parameters_of_kind_template_011 { + + type component GeneralComp { + } + + function f (template integer p_int := -) { + log(p_int); + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_011() runs on GeneralComp { + f(1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..032fd90f77150bff72c2131b9c7b5d54a610c53e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_012.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that error is generated if formal template parameter of altstep contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040102_parameters_of_kind_template_012 { + + type component GeneralComp { + } + + altstep a(template integer p_int := -) { + []any timer.timeout {} + [else] {} + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_012() runs on GeneralComp { + a(1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_012()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f1484fd837539e6814c4a6d00475a9ea2fb00ed --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_013.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that error is generated if formal template parameter of test case contains dash + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction g) +// The dash (don't change) symbol shall be used with formal parameters of modified templates only + +module NegSem_05040102_parameters_of_kind_template_013 { + + type component GeneralComp { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_013(omit integer p_int := -) runs on GeneralComp { + log(p_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_013(1)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fc64136efaaa8f13ca46e82b293af74785d64f8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_014.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that out formal template parameters cannot have lazy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// Only in template parameters can be declared lazy or fuzzy. + +module NegSem_05040102_parameters_of_kind_template_014 { + + type component GeneralComp { + } + + function f(out template @lazy integer p_int) { + p_int := ?; + } + testcase TC_NegSem_05040102_parameters_of_kind_template_014() runs on GeneralComp { + var template integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_014()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9bb1b2b6fb9655f878733bd74894e2f9a21753ed --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_015.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that out formal template parameters cannot have fuzzy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// Only in template parameters can be declared lazy or fuzzy. + +module NegSem_05040102_parameters_of_kind_template_015 { + + type component GeneralComp { + } + + function f(out template @fuzzy integer p_int) { + p_int := ?; + } + testcase TC_NegSem_05040102_parameters_of_kind_template_015() runs on GeneralComp { + var template integer v_int; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a215bfe5344cc0b0367a95a36f326c4dd7fda2e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_016.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that inout formal template parameters cannot have lazy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// Only in template parameters can be declared lazy or fuzzy. + +module NegSem_05040102_parameters_of_kind_template_016 { + + type component GeneralComp { + } + + function f(inout template @lazy integer p_int) { + p_int := ?; + } + testcase TC_NegSem_05040102_parameters_of_kind_template_016() runs on GeneralComp { + var template integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_016()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1d238c45c58dc7046b61d3b2cb5a10bf1855405 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_017.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that inout formal template parameters cannot have fuzzy modifier + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction h) +// Only in template parameters can be declared lazy or fuzzy. + +module NegSem_05040102_parameters_of_kind_template_017 { + + type component GeneralComp { + } + + function f(inout template @fuzzy integer p_int) { + p_int := ?; + } + testcase TC_NegSem_05040102_parameters_of_kind_template_017() runs on GeneralComp { + var template integer v_int := 0; + f(v_int); + log(v_int); + setverdict(pass); + } + + control{ + execute(TC_NegSem_05040102_parameters_of_kind_template_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..292d03e41b44cccaa78de3b9e7ccb9a56b30f8b8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_018.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, Verify that template parameter of an activated altstep cannot be an out parameter + ** @verdict pass reject + *****************************************************************/ + +module NegSem_05040102_parameters_of_kind_template_018 { + + altstep a_test(out template integer p_par) runs on C { + [] any timer.timeout { + p_par := ?; + } + } + + type component C { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_018() { + var integer v_int := ?; + activate(a_test(v_int)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040102_parameters_of_kind_template_018()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f95fb920e49649b20de85088bf43c7175f9786d7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSem_05040102_parameters_of_kind_template_019.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, Verify that template parameter of an activated altstep cannot be an inout parameter + ** @verdict pass reject + *****************************************************************/ + +module NegSem_05040102_parameters_of_kind_template_018 { + + altstep a_test(inout template integer p_par) runs on C { + [] any timer.timeout { + p_par := ?; + } + } + + type component C { + } + + testcase TC_NegSem_05040102_parameters_of_kind_template_018() { + var integer v_int := ?; + activate(a_test(v_int)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040102_parameters_of_kind_template_018()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSyn_05040102_parameters_of_kind_template_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSyn_05040102_parameters_of_kind_template_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14c646d0efc4ff5e9e8714c2810ba5c29562298d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/NegSyn_05040102_parameters_of_kind_template_001.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that module parameter of template kind is not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction a) +// Only function, testcase, altstep and template definitions may have formal template parameters. + +module NegSyn_05040102_parameters_of_kind_template_001 { + modulepar template integer PX_TEMPLATE_PAR; +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..900c429dae3f6fbd77505395621eb38788640ed9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, Ensure that the IUT correctly handles parametrization through the use of parameterized templates. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040102_parameters_of_kind_template_001 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + +template MyRecord m_parametrizedTemplate + ( + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) := { + field1 := p_integer, + field2 := p_boolean, + field3 := p_address, + field4 := p_enumerated, + field5 := p_integerTemplate +} + + + +type component GeneralComp { + +} + + +testcase TC_Sem_05040102_parameters_of_kind_template_001() runs on GeneralComp { + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + var MyRecord PartlyModifiedValues := { + field1 := 0, + field2 := false, + field3 := null, + field4 := e_white, + field5 := 1 + } + + if ( + match(DefaultValues, m_parametrizedTemplate) and + match(ModifiedValues, m_parametrizedTemplate(1,false,1,e_white,1)) and + match(PartlyModifiedValues, m_parametrizedTemplate(-,false,-,e_white,-)) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + execute(TC_Sem_05040102_parameters_of_kind_template_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a6dafc1e220510064b1765284ca638524d9f6c1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, Ensure that the IUT correctly handles parametrization through the use of parameterized templates. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040102_parameters_of_kind_template_002 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + + +type component GeneralComp { + +} + + +testcase TC_Sem_05040102_parameters_of_kind_template_002 ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + var template MyRecord ReceivedRecord := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + if (match(ExpectedMatch, ReceivedRecord)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + var MyRecord PartlyModifiedValues := { + field1 := 0, + field2 := false, + field3 := null, + field4 := e_white, + field5 := 1 + } + + execute(TC_Sem_05040102_parameters_of_kind_template_002(DefaultValues)); + execute(TC_Sem_05040102_parameters_of_kind_template_002(DefaultValues,-,-,-,-,-)); + execute(TC_Sem_05040102_parameters_of_kind_template_002(ModifiedValues,1,false,1,e_white,1)); + execute(TC_Sem_05040102_parameters_of_kind_template_002(PartlyModifiedValues,-,false,-,e_white,-)); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..009a4ae0ce5d2239da7ac729697de411f83e4c8e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_003.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definition can contain in template formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Templates parameters can be defined for templates, functions, altsteps, and test cases. +// To enable a parameterized object to accept templates or matching symbols as actual parameters, +// the extra keyword template shall be added before the type field of the corresponding formal +// parameter. This makes the parameter a template parameter and in effect extends the allowed actual +// parameters for the associated type to include the appropriate set of matching attributes (see +// annex B) as well as the normal set of values. +// Formal template parameters may be in, inout or out parameters. The default for formal template +// parameters is in parameterization. + +module Sem_05040102_parameters_of_kind_template_003 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R mw_t(template integer p_int1, in template integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_003() runs on GeneralComp { + log(mw_t(3, ?)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f84c386b327f80ea0a9e74ec7f3d6e16b10b49e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that local template definition can contain in template formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Templates parameters can be defined for templates, functions, altsteps, and test cases. +// To enable a parameterized object to accept templates or matching symbols as actual parameters, +// the extra keyword template shall be added before the type field of the corresponding formal +// parameter. This makes the parameter a template parameter and in effect extends the allowed actual +// parameters for the associated type to include the appropriate set of matching attributes (see +// annex B) as well as the normal set of values. +// Formal template parameters may be in, inout or out parameters. The default for formal template +// parameters is in parameterization. + +module Sem_05040102_parameters_of_kind_template_004 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_004() runs on GeneralComp { + template R m_t(template integer p_int1, in template integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3, ?)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..314d7e4f359bd40e5df40c0a323c390c306d3cff --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_005.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that function definition can contain in, out and inout template formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Templates parameters can be defined for templates, functions, altsteps, and test cases. +// To enable a parameterized object to accept templates or matching symbols as actual parameters, +// the extra keyword template shall be added before the type field of the corresponding formal +// parameter. This makes the parameter a template parameter and in effect extends the allowed actual +// parameters for the associated type to include the appropriate set of matching attributes (see +// annex B) as well as the normal set of values. +// Formal template parameters may be in, inout or out parameters. The default for formal template +// parameters is in parameterization. + +module Sem_05040102_parameters_of_kind_template_005 { + + type component GeneralComp { + } + + function f(template integer p_int1, in template integer p_int2, out template integer p_int3, inout template integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_005() runs on GeneralComp { + var template integer v_int1, v_int2 := ?; + f((1..3), 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b4d279afab1845f98a287df11750df5e3f84c86 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_006.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that altstep definition can contain in, out and inout template formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Templates parameters can be defined for templates, functions, altsteps, and test cases. +// To enable a parameterized object to accept templates or matching symbols as actual parameters, +// the extra keyword template shall be added before the type field of the corresponding formal +// parameter. This makes the parameter a template parameter and in effect extends the allowed actual +// parameters for the associated type to include the appropriate set of matching attributes (see +// annex B) as well as the normal set of values. +// Formal template parameters may be in, inout or out parameters. The default for formal template +// parameters is in parameterization. + +module Sem_05040102_parameters_of_kind_template_006 { + + type component GeneralComp { + } + + altstep a(template integer p_int1, in template integer p_int2, out template integer p_int3, inout template integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_006() runs on GeneralComp { + var template integer v_int1, v_int2 := ?; + a((1..3), 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d62352f8f45896c1bee4ec9a5dd57e9698988f4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_007.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that test case definition can contain in, out and inout template formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Templates parameters can be defined for templates, functions, altsteps, and test cases. +// To enable a parameterized object to accept templates or matching symbols as actual parameters, +// the extra keyword template shall be added before the type field of the corresponding formal +// parameter. This makes the parameter a template parameter and in effect extends the allowed actual +// parameters for the associated type to include the appropriate set of matching attributes (see +// annex B) as well as the normal set of values. +// Formal template parameters may be in, inout or out parameters. The default for formal template +// parameters is in parameterization. + +module Sem_05040102_parameters_of_kind_template_007 { + + type component GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_007( + template integer p_int1, in template integer p_int2, out template integer p_int3, inout template integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var template integer v_int1, v_int2 := ?; + execute(TC_Sem_05040102_parameters_of_kind_template_007((1..3), 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..594f15ce58a4c60ae9d7f2c08173b1ce35b69326 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_008.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template formal parameters can be used in the same way as templates or template variables + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be used within the parameterized object the same way as +// templates and template variables. + +module Sem_05040102_parameters_of_kind_template_008 { + + type component GeneralComp { + } + + function f(template integer p_int1, in template integer p_int2) { + p_int1 := ?; // modification + if (match(1, p_int2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_008() runs on GeneralComp { + f(*, (0..5)); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4152f7ebe7a251ba9e5910ec6b1cb023fbc6536e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_009.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of template can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default template, which is given by a template instance +// assigned to the parameter. + +module Sem_05040102_parameters_of_kind_template_009 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R mw_t(template integer p_int1 := ?, in template integer p_int2 := (0..5)) := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1bc23b66f1db706820817f16304ba3219d529b6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of local template can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default template, which is given by a template instance +// assigned to the parameter. + +module Sem_05040102_parameters_of_kind_template_010 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f() { + template R m_t(template integer p_int1 := ?, in template integer p_int2 := (0..5)) := { + field1 := p_int1, + field2 := p_int2 + } + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..432e9e6e0acff635415ea81759d0feb3e580d186 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_011.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of function can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default template, which is given by a template instance +// assigned to the parameter. + +module Sem_05040102_parameters_of_kind_template_011 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + function f(template integer p_int1 := ?, in template integer p_int2 := (0..5)) { + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9bf52dd182149caeeab5ce3b458912132bf29f57 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_012.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of altstep can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default template, which is given by a template instance +// assigned to the parameter. + +module Sem_05040102_parameters_of_kind_template_012 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + altstep a(template integer p_int1 := ?, in template integer p_int2 := (0..5)) { + [] any timer.timeout {} + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..210d66740308fcd20828bf39fc83bac8d5f0f183 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_013.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of test case can have default values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// In parameters may have a default template, which is given by a template instance +// assigned to the parameter. + +module Sem_05040102_parameters_of_kind_template_013 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + testcase TC(template integer p_int1 := ?, in template integer p_int2 := (0..5)) runs on GeneralComp { + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..458ed45bc129c98b8427d1c6c392ca57f2b80e47 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_014.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that in template formal parameters of modified template can used dash as default value + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters of modified templates may inherit their default templates from the +// corresponding parameters of their parent templates; this shall explicitly be denoted by using +// a dash (don't change) symbol at the place of the modified template parameter's default template. + +module Sem_05040102_parameters_of_kind_template_014 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 + } + + template R mw_t(template integer p_int1 := ?, in template integer p_int2 := (0..5)) := { + field1 := p_int1, + field2 := p_int2 + } + + template R mw_tmod(template integer p_int1 := 10, in template integer p_int2 := -) modifies mw_t := { + field1 := p_int1, + field2 := p_int2 + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19d93d031746fcc668b3305f8655d157608ad994 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_015.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definition can contain in template formal parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_015 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + template R mw_t(template(omit) integer p_int1, in template(omit) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_015() runs on GeneralComp { + log(mw_t(3, omit)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d3a1a53aa4a64713b1df39454a9d7a5326e5dd0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_016.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that local template definition can contain in template formal parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_016 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + testcase TC_Sem_05040102_parameters_of_kind_template_016() runs on GeneralComp { + template R m_t(template(omit) integer p_int1, in template(omit) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3, omit)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_016()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..914cb1fbe4c03ac656d8f9da424f8b1b216424e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_017.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that function definition can contain in, out and inout template formal parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_017 { + + type component GeneralComp { + } + + function f(template(omit) integer p_int1, in template(omit) integer p_int2, + out template(omit) integer p_int3, inout template(omit) integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_017() runs on GeneralComp { + var template(omit) integer v_int1, v_int2 := 20; + f(omit, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8aa0a31962447bc5bfa368e3fafaaf6e3984444 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_018.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that altstep definition can contain in, out and inout template formal parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_018 { + + type component GeneralComp { + } + + altstep a(template(omit) integer p_int1, in template(omit) integer p_int2, + out template(omit) integer p_int3, inout template(omit) integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_018() runs on GeneralComp { + var template(omit) integer v_int1, v_int2 := omit; + a(0, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_018()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e62040fed539e68cd2a36216bf258a67a68127d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_019.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that test case definition can contain in, out and inout template formal parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_019 { + + type component GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_019( + template(omit) integer p_int1, in template(omit) integer p_int2, + out template(omit) integer p_int3, inout template(omit) integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var template(omit) integer v_int1, v_int2 := 20; + execute(TC_Sem_05040102_parameters_of_kind_template_019(omit, 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_020.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cdaa21e315c4cce55f081f3b4c781318d9c0dcda --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_020.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definition can contain in template formal parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_020 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + template R mw_t(template(present) integer p_int1, in template(present) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_020() runs on GeneralComp { + log(mw_t(3, (0..5))); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_020()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_021.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7aa209cdd84cd7c91946724d1f9155b4c826ddf8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_021.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that local template definition can contain in template formal parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_021 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + testcase TC_Sem_05040102_parameters_of_kind_template_021() runs on GeneralComp { + template R m_t(template(present) integer p_int1, in template(present) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3, (0..5))); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_021()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_022.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..443f762031758eb0c06380dec4e678d649a8a7fa --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_022.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that function definition can contain in, out and inout template formal parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_022 { + + type component GeneralComp { + } + + function f(template(present) integer p_int1, in template(present) integer p_int2, + out template(present) integer p_int3, inout template(present) integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_022() runs on GeneralComp { + var template(present) integer v_int1, v_int2 := 20; + f((0..5), 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_022()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_023.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b148b09471371a56f13a49a9a2ea680775f4cab --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_023.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that altstep definition can contain in, out and inout template formal parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_023 { + + type component GeneralComp { + } + + altstep a(template(present) integer p_int1, in template(present) integer p_int2, + out template(present) integer p_int3, inout template(present) integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_023() runs on GeneralComp { + var template(present) integer v_int1, v_int2 := (0..5); + a(0, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_023()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_024.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2a612ac83fac9b18b9f82bd9c988fca45ae1aef --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_024.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that test case definition can contain in, out and inout template formal parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_024 { + + type component GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_024( + template(present) integer p_int1, in template(present) integer p_int2, + out template(present) integer p_int3, inout template(present) integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var template(present) integer v_int1, v_int2 := 20; + execute(TC_Sem_05040102_parameters_of_kind_template_024((0..5), 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_025.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1d096fb417a1bde2901a2f7f1eb5487cdf7f6da --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_025.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definition can contain in template formal parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_025 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + template R mw_t(template(value) integer p_int1, in template(value) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_025() runs on GeneralComp { + log(mw_t(3, 4)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_025()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_026.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5646bc1f468dda50f59b7a041cf8122e76720858 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_026.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that local template definition can contain in template formal parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_026 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + testcase TC_Sem_05040102_parameters_of_kind_template_026() runs on GeneralComp { + template R m_t(template(value) integer p_int1, in template(value) integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3, 4)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_026()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_027.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7053ccf9fa03a7192e70bb2b39e1ce396f65b167 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_027.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that function definition can contain in, out and inout template formal parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_027 { + + type component GeneralComp { + } + + function f(template(value) integer p_int1, in template(value) integer p_int2, + out template(value) integer p_int3, inout template(value) integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_027() runs on GeneralComp { + var template(value) integer v_int1, v_int2 := 20; + f(0, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_027()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_028.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47870e7658939dc27cabb99ec1fc54bcd9a61dfb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_028.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that altstep definition can contain in, out and inout template formal parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_028 { + + type component GeneralComp { + } + + altstep a(template(value) integer p_int1, in template(value) integer p_int2, + out template(value) integer p_int3, inout template(value) integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_028() runs on GeneralComp { + var template(value) integer v_int1, v_int2 := 20; + a(0, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_028()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_029.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32846c2e7752531832dc8220b3b526bfa9559d01 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_029.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that test case definition can contain in, out and inout template formal parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. + +module Sem_05040102_parameters_of_kind_template_029 { + + type component GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_029( + template(value) integer p_int1, in template(value) integer p_int2, + out template(value) integer p_int3, inout template(value) integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var template(value) integer v_int1, v_int2 := 20; + execute(TC_Sem_05040102_parameters_of_kind_template_029(0, 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_030.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eff5951d719dcd29a4362f557be3cebee90b96f1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_030.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that template definition can contain in template formal parameters with short omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. The restriction template (omit) can be replaced by the shorthand notation omit. + +module Sem_05040102_parameters_of_kind_template_030 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + template R mw_t(omit integer p_int1, in omit integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + + testcase TC_Sem_05040102_parameters_of_kind_template_030() runs on GeneralComp { + log(mw_t(3, omit)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_030()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_031.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9d1874b30d43141d1168947aa5ca59377233fa8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_031.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that local template definition can contain in template formal parameters with short omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. The restriction template (omit) can be replaced by the shorthand notation omit. + +module Sem_05040102_parameters_of_kind_template_031 { + + type component GeneralComp { + } + + type record R + { + integer field1, + integer field2 optional + } + + testcase TC_Sem_05040102_parameters_of_kind_template_031() runs on GeneralComp { + template R m_t(omit integer p_int1, in omit integer p_int2) := { + field1 := p_int1, + field2 := p_int2 + } + log(m_t(3, omit)); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_031()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_032.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cefe5a6966eeddf3bf4cd26c0489eac876c83ec --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_032.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that function definition can contain in, out and inout template formal parameters with short omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. The restriction template (omit) can be replaced by the shorthand notation omit. + +module Sem_05040102_parameters_of_kind_template_032 { + + type component GeneralComp { + } + + function f(omit integer p_int1, in omit integer p_int2, + out omit integer p_int3, inout omit integer p_int4){ + setverdict(pass); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_032() runs on GeneralComp { + var omit integer v_int1, v_int2 := 20; + f(omit, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_032()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_033.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97772bbef183c8a3cd83d57745edc89b95e51c26 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_033.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that altstep definition can contain in, out and inout template formal parameters with short omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. The restriction template (omit) can be replaced by the shorthand notation omit. + +module Sem_05040102_parameters_of_kind_template_033 { + + type component GeneralComp { + } + + altstep a(omit integer p_int1, in omit integer p_int2, + out omit integer p_int3, inout omit integer p_int4) { + [] any timer.timeout { setverdict(fail); } + [else] { setverdict(pass); } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_033() runs on GeneralComp { + var omit integer v_int1, v_int2 := omit; + a(0, 2, v_int1, v_int2); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_033()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_034.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73279e321c581440cf8c093469dfadf9f3c5d69a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_034.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that test case definition can contain in, out and inout template formal parameters with short omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal template parameters can be restricted to accept actual parameters containing a restricted +// set of matching mechanisms only. Such limitations can be expressed by the restrictions omit, +// present, and value. The restriction template (omit) can be replaced by the shorthand notation omit. + +module Sem_05040102_parameters_of_kind_template_034 { + + type component GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_034( + omit integer p_int1, in omit integer p_int2, + out omit integer p_int3, inout omit integer p_int4) runs on GeneralComp { + setverdict(pass); + } + + control { + var omit integer v_int1, v_int2 := 20; + execute(TC_Sem_05040102_parameters_of_kind_template_034(omit, 2, v_int1, v_int2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_035.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5aa18e7a01a0ff770207cb80d42129624dfbe5d1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_035.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that null is suitable default value of formal template parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// Default templates of component type formal parameters shall be built from the special values +// null, mtc, self, or system. + +module Sem_05040102_parameters_of_kind_template_035 { + + type component GeneralComp { + } + + function f(template GeneralComp p_comp := null) { + log(p_comp); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_035() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_035()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_036.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff604f0ce1e5dbf85e9809eafbab6f16e59a03c6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_036.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that self is suitable default value of formal template parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// Default templates of component type formal parameters shall be built from the special values +// null, mtc, self, or system. + +module Sem_05040102_parameters_of_kind_template_036 { + + type component GeneralComp { + } + + function f(template GeneralComp p_comp := self) { + log(p_comp); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_036() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_036()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_037.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02ab264593350d7061ded8f69fb143d80cbbd9ab --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_037.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that mtc is suitable default value of formal template parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// Default templates of component type formal parameters shall be built from the special values +// null, mtc, self, or system. + +module Sem_05040102_parameters_of_kind_template_037 { + + type component GeneralComp { + } + + function f(template GeneralComp p_comp := mtc) { + log(p_comp); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_037() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_037()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_038.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b51c122d04183e85961b70e75f49c54d23f89b3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_038.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that system is suitable default value of formal template parameters of component type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction e) +// Default templates of component type formal parameters shall be built from the special values +// null, mtc, self, or system. + +module Sem_05040102_parameters_of_kind_template_038 { + + type component GeneralComp { + } + + function f(template GeneralComp p_comp := system) { + log(p_comp); + } + + testcase TC_Sem_05040102_parameters_of_kind_template_038() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_038()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_039.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4112bfd1f00b166aa663e01f322f21456d881d92 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_039.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.2 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters can reference component elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Background: +// Prior to the version TTCN-3:2017, the template instance could not refer to elements of the component type referenced in the runs on clause. + +module Sem_05040102_parameters_of_kind_template_039 { + type component GeneralComp { + var template integer vc_int := ?; + } + + function f(in template integer p_int := vc_int) runs on GeneralComp { + } + + testcase TC_Sem_05040102_parameters_of_kind_template_039() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_039()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_040.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ce916f76f2ac9dd9b6d32e8bd9da8ef48d5edb0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_040.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.2 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters can invoke functions with runs on clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Background: +// Prior to the version TTCN-3:2017, the template instance could not contain invocation of functions with a runs on clause. + +module Sem_05040101_parameters_of_kind_value_040 { + type component GeneralComp { + var integer vc_int := 1; + } + + function fx() runs on GeneralComp return template integer { + return (vc_int..100); + } + + function f(in template integer p_int := fx()) runs on GeneralComp { + log(p_int); + } + + testcase TC_Sem_05040101_parameters_of_kind_value_040() runs on GeneralComp { + f(); + setverdict(pass); + } + + control{ + execute(TC_Sem_05040101_parameters_of_kind_value_040()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_041.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b65909d66015d304aac58c90b78003dd6f311ede --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_parameters_of_kind_template_041.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:5.4.1.2, verify that default template instance of template formal parameters is resolved in the scope of the parameterized entity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If a default template is used, it is evaluated in the scope of the parameterized entity, not the scope of the actual parameter list. + +module Sem_05040102_parameters_of_kind_template_041 { + type component GeneralComp { + var template integer vc_int := ?; + } + + function f(in template integer p_int := vc_int) runs on GeneralComp { + if (match(10, p_int)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_05040102_parameters_of_kind_template_041() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + vc_int := (1, 2, 3); + v_ptc.start(f()); // p_int default to ? (vc_int of v_ptc) and not to (1, 2, 3) (vc_int of self) + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_05040102_parameters_of_kind_template_041()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c9c6f073c378f08fc7502a480bd124c3ad39651 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that functions with timer parameters cannot be used in component.start operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040103_parameters_of_kind_timer_001 { + + type component C { + } + + function f_test(inout timer p_tmr) runs on C { + p_tmr.timeout; + setverdict(pass); + } + + testcase TC_NegSem_05040103_parameters_of_kind_timer_001() runs on C system C { + timer t_tmr := 0.1; + var C v_ptc := C.create; + t_tmr.start; + v_ptc.start(f_test(t_tmr)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040103_parameters_of_kind_timer_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f091949712872f443ae7dc0d923c2f799bc1f13 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that altsteps with timer parameters cannot be used in component.start operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040103_parameters_of_kind_timer_002 { + + type component C { + } + + altstep f_test(inout timer p_tmr) runs on C { + [] p_tmr.timeout { + setverdict(pass); + } + } + + testcase TC_NegSem_05040103_parameters_of_kind_timer_002() runs on C system C { + timer t_tmr := 0.1; + var C v_ptc := C.create; + t_tmr.start; + v_ptc.start(f_test(t_tmr)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040103_parameters_of_kind_timer_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b698dc444e62f63458445be75819b4c4580619b3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_003.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that test cases cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040103_parameters_of_kind_timer_003 { + + type component C { + } + + testcase TC_NegSem_05040103_parameters_of_kind_timer_003(timer p_tmr) runs on C { + p_tmr.timeout; + setverdict(pass); + } + + control { + timer t_tmr := 0.1; + t_tmr.start; + execute(TC_NegSem_05040103_parameters_of_kind_timer_003(t_tmr)); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fae59e387b6f64acdd1b08e15a0a3a5c69f07f63 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSem_05040103_parameters_of_kind_timer_004.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that templates cannot have timer parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module NegSem_05040103_parameters_of_kind_timer_004 { + + type component C { + } + + template boolean m_msg (timer p_tmr) := p_tmr.running; + + testcase TC_NegSem_05040103_parameters_of_kind_timer_004() runs on C system C { + timer t_tmr := 0.1; + t_tmr.start; + log(m_msg(t_tmr)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040103_parameters_of_kind_timer_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c774ec9460826cd39552239afad5249995aa4b9b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that in timer parameters are not allowed + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module NegSyn_05040103_parameters_of_kind_timer_001 { + + type component C { + } + + function f_test(in timer p_tmr) { + p_tmr.timeout; + } + + testcase TC_NegSyn_05040103_parameters_of_kind_timer_001() runs on C { + timer t_tmr := 1.0; + t_tmr.start; + f_test(t_tmr); + setverdict(pass); + } + + control { + execute(TC_NegSyn_05040103_parameters_of_kind_timer_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae884d8438668dedf4c5f9ea633977899e9258e9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/NegSyn_05040103_parameters_of_kind_timer_002.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that out timer parameters are not allowed + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module NegSyn_05040103_parameters_of_kind_timer_002 { + + type component C { + + } + + function f_test(out timer p_tmr) { + + p_tmr.start(1.0); + + } + + + testcase TC_NegSyn_05040103_parameters_of_kind_timer_002() runs on C{ + + timer t_tmr; + + f_test(t_tmr); + + t_tmr.timeout; + setverdict(pass); + + } + + + control { + + execute(TC_NegSyn_05040103_parameters_of_kind_timer_002()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cda1d79542413dfc5086379144e7886058175009 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_001.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Ensure that the IUT correctly handles parametrization through the use of timer parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_05040103_parameters_of_kind_timer_001 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + +type port TestPort message { + inout MyRecord +} + +type component GeneralComp { + port TestPort generalPort; + port TestPort otherport; +} +function f_parametrizationCheck ( + MyRecord ExpectedMatch, + timer p_timer, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + var template MyRecord ReceivedRecordTemplate := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + if ( match(ExpectedMatch, ReceivedRecordTemplate) and (p_timer.running) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + +testcase TC_Sem_05040103_parameters_of_kind_timer_001 ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(5.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate); + + t_check.stop; + +} + + +control{ + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + var MyRecord PartlyModifiedValues := { + field1 := 0, + field2 := false, + field3 := null, + field4 := e_white, + field5 := 1 + } + + execute(TC_Sem_05040103_parameters_of_kind_timer_001(DefaultValues)); + execute(TC_Sem_05040103_parameters_of_kind_timer_001(DefaultValues,-,-,-,-,-)); + execute(TC_Sem_05040103_parameters_of_kind_timer_001(ModifiedValues,1,false,1,e_white,1)); + execute(TC_Sem_05040103_parameters_of_kind_timer_001(PartlyModifiedValues,-,false,-,e_white,-)); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50b9f7ac1e1d8e7a826c8955c6d447ac7212d676 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that inout prefix can be used for timer parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Formal timer parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module Sem_05040103_parameters_of_kind_timer_002 { + + type component C { + } + + function f_test(inout timer p_tmr) { + p_tmr.timeout; + setverdict(pass); + } + + testcase TC_Sem_05040103_parameters_of_kind_timer_001() runs on C { + timer t_tmr := 0.1; + t_tmr.start; + f_test(t_tmr); + } + + control { + execute(TC_Sem_05040103_parameters_of_kind_timer_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc23dca35458d1c783069f7325169e56a78a8fc6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040103_parameters_of_kind_timer/Sem_05040103_parameters_of_kind_timer_003.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.3, Verify that altstep can have timer parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Only function and altstep definitions may have formal timer parameters, with the exception of functions or +// altsteps started as test component behaviour (see clause 21.3.2). + +module Sem_05040103_parameters_of_kind_timer_003 { + + type component C { + } + + altstep a_test(timer p_tmr) { + [] p_tmr.timeout { + setverdict(pass); + } + } + + testcase TC_Sem_05040103_parameters_of_kind_timer_001() runs on C { + timer t_tmr := 0.1; + t_tmr.start; + a_test(t_tmr); + } + + control { + execute(TC_Sem_05040103_parameters_of_kind_timer_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96980d459dc9a878323d838e9c9a12a9dbb291f6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that functions 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_05040104_parameters_of_kind_port_001 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + function f_test(P p_port) runs on C { + p_port.send(1); + setverdict(pass); + } + + testcase TC_NegSem_05040104_parameters_of_kind_port_001() runs on C system C { + var C v_ptc := C.create; + v_ptc.start(f_test(p)); + v_ptc.done; + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c1b7b6ee4627f8ceb75cae65a22ae979375884d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, 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_05040104_parameters_of_kind_port_002 { + + 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_05040104_parameters_of_kind_port_002() 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_05040104_parameters_of_kind_port_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91c9376a0a75aaf7f873fca9a9b58cd9cec17162 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that in port parameters are not allowed + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module NegSem_05040104_parameters_of_kind_port_003 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(in P p_port) { + p_port.send(1); + } + + testcase TC_NegSem_05040104_parameters_of_kind_port_003() runs on C { + f_test(p); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c3bf6ebd6dcd1dc84a2e4b38e9df05db829f0ee --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_004.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that out port parameters are not allowed + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module NegSem_05040104_parameters_of_kind_port_004 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(out P p_port) { + setverdict(pass); + } + + testcase TC_NegSem_05040104_parameters_of_kind_port_004() runs on C { + f_test(p); + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04eeb605ea0d46c5ddfa8d0b7064c847bfca9ed4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_005.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that test cases cannot have port parameters + ** @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_05040104_parameters_of_kind_port_005 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + testcase TC_Test(P p_port) runs on C { // should cause a compilation error + p_port.send(1); + setverdict(pass); + } + + testcase TC_NegSem_05040104_parameters_of_kind_port_005(P p_port) runs on C { + setverdict(pass); + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3d53bef4f5b8c3af8382a0aa0d9fe5c1de5cc72 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/NegSem_05040104_parameters_of_kind_port_006.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that templates cannot contain port parameters + ** @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_05040104_parameters_of_kind_port_006 { + + type port P message { + inout integer + } + type component C { + port P p; + } + + template boolean m_msg(P p_par) := p_par.checkstate("Started"); + + testcase TC_NegSem_05040104_parameters_of_kind_port_006() runs on C system C { + log(m_msg(p)); + setverdict(pass); + } + + control { + execute(TC_NegSem_05040104_parameters_of_kind_port_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10a4d2e61d6946d0af9df1dacc695484d837d662 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_001.ttcn @@ -0,0 +1,111 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Ensure that the IUT accepts port parametrization types for functions. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_05040104_parameters_of_kind_port_001 { + + type enumerated MyEnumeratedType {e_black, e_white} + type integer address; + + type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 + } + + type port TestPort message { + inout MyRecord + } + + type component GeneralComp { + port TestPort generalPort; + port TestPort otherPort; + } + + function f_parametrizationCheck ( + MyRecord ExpectedMatch, + timer p_timer, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ?, + TestPort p_port + ) runs on GeneralComp { + var template MyRecord ReceivedRecordTemplate := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + p_port.send(ExpectedMatch); + } + + testcase TC_Sem_05040104_parameters_of_kind_port_001_a ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(5.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,generalPort); + alt { + [] generalPort.receive { + setverdict(pass); + } + [] t_check.timeout { + setverdict(fail); + } + } + + t_check.stop; + + } + + testcase TC_Sem_05040104_parameters_of_kind_port_001_b ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + timer t_check; + t_check.start(1.0); + f_parametrizationCheck(ExpectedMatch, t_check, p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate,otherPort); + alt { + [] otherPort.receive { + setverdict(pass); + } + [] t_check.timeout { + setverdict(fail); + } + } + + t_check.stop; + + } + + + control{ + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + //the following testcases will call same function with different port parameter values + execute(TC_Sem_05040104_parameters_of_kind_port_001_a(ModifiedValues,1,false,1,e_white,1)); + execute(TC_Sem_05040104_parameters_of_kind_port_001_b(ModifiedValues,1,false,1,e_white,1)); + + } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dcfe29d552d3f4688a7997ae175b7ee4cbd133ec --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040104_parameters_of_kind_port/Sem_05040104_parameters_of_kind_port_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.1.4, Verify that inout prefix can be used for port parameters + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Formal port parameters shall be inout parameters, which can optionally be indicated by the keyword inout. + +module Sem_05040104_parameters_of_kind_port_002 { + + type port P message { + inout integer + } + + type component C { + port P p; + } + + function f_test(inout P p_port) { + p_port.send(1); + setverdict(pass); + } + + testcase TC_Sem_05040104_parameters_of_kind_port_002() runs on C { + f_test(p); + } + + control { + execute(TC_Sem_05040104_parameters_of_kind_port_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NOTES b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..245e7102ed50169598df132b8e5e3bf293b13d00 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NOTES @@ -0,0 +1,7 @@ +The following requirements are present in 5.4.1.1 and 5.4.1.2 too and they are tested as a part of these clauses: + +Formal parameters of parameterized templates, functions, altsteps, and testcases are defined in formal parameter lists. Formal parameters shall be in, inout or out parameters (see definitions in clause 3.1). + +If not stated otherwise, a formal parameter is an in parameter. + +Formal in parameters may have default values. This default value is used when no actual parameter is provided. \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45c72a2ddf161cc361d65f166762b0e48bb50b5a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that error is generated for incompatible actual value of in parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If parameters are passed by value (i.e. in case of in and out parameters), type compatibility +// rules specified in 6.3 apply. + +module NegSem_050401_top_level_001 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer option1, + integer option2 optional + } + + function f(R2 p_rec) { + if (match(p_rec, {1, 2})) { + setverdict(pass); + } else { + setverdict(fail, "p_rec value not matching ", p_rec, {1, 2}); + } + } + + testcase TC_NegSem_050401_top_level_001() runs on GeneralComp { + var R1 v_rec := {field1 := 1, field2 := 2}; + f(v_rec); + } + + control{ + execute(TC_NegSem_050401_top_level_001()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f73bb342a8381d72283ea1ad9f169b634000cda6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_002.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that error is generated for incompatible actual value of out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If parameters are passed by value (i.e. in case of in and out parameters), type compatibility +// rules specified in 6.3 apply. + +module NegSem_050401_top_level_002 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer option1, + integer option2 optional + } + + function f(out R2 p_rec) { + p_rec.option1 := 1; + p_rec.option2 := 2; + } + + testcase TC_NegSem_050401_top_level_002() runs on GeneralComp { + var R1 v_rec; + f(v_rec); + if ( match(v_rec, {1, 2})) { setverdict(pass); } + else { setverdict(fail, "p_rec value not matching ", v_rec, {1, 2}); } + } + + control{ + execute(TC_NegSem_050401_top_level_002()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42d664bd771f916beeb0039fa7c0b8c80f28b72d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/NegSem_050401_top_level_003.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that error is generated if actual inout parameter doesn't adhere to strong typing rules + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When parameters are passed by reference, strong typing is required. Both the actual and formal +// parameter shall be of the same type. + +module NegSem_050401_top_level_003 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer option1, + integer option2 + } + + function f(inout R2 p_rec) { + if (match(p_rec, {1, 2})) { setverdict(pass); } + else { setverdict(fail, "p_rec value not matching ", p_rec, {1, 2}); } + } + + testcase TC_NegSem_050401_top_level_003() runs on GeneralComp { + var R1 v_rec := { field1 := 1, field2 := 2 }; + f(v_rec); // R1 and R2 are compatible types, but not the same. Strong typing requires exactly the same types. + } + + control{ + execute(TC_NegSem_050401_top_level_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb94c1de40231c3073555eec710df7240ae2d9c8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that in parameters can be read within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_001 { + + type component GeneralComp { + } + + function f(in integer p_int) { + if (p_int == 0) { setverdict(pass); } // reading from p_int + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_001() runs on GeneralComp { + f(0); + } + + control{ + execute(TC_Sem_050401_top_level_001()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6f3dc9d958dc41d1e851090dcc75058a7aa9992 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_002.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that out parameters can be read within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_002 { + + type component GeneralComp { + } + + function f(out integer p_int) { + log(p_int); // read access: UNINITIALIZED shall be printed as no assignment has been made + } + + testcase TC_Sem_050401_top_level_002() runs on GeneralComp { + var integer v_int := 10; + f(v_int); + if (v_int == 10) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_050401_top_level_002()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d66ae141a513f2b8e7677cce67c46963ae213b7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that inout parameters can be read within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_003 { + + type component GeneralComp { + } + + function f(inout integer p_int) { + if (p_int == 0) { setverdict(pass); } // reading from p_int + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_003() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44dc54ff618d3f30da00c75c83a5fbf888ee8a20 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_004.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that in parameters can be set within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_004 { + + type component GeneralComp { + } + + function f(in integer p_int) { + p_int := 3; // setting p_int within parametrized content + if (p_int == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_004() runs on GeneralComp { + f(0); + } + + control{ + execute(TC_Sem_050401_top_level_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c050905581e1bddb67ded8faff2f79e471a6c6bd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_005.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that out parameters can be set within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_005 { + + type component GeneralComp { + } + + function f(out integer p_int) { + p_int := 3; // setting p_int within parametrized content + if (p_int == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_005() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82012d965b95780231fced22d017fc9ddcb8db73 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_006.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that inout parameters can be set within parametrized content + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For all these three sorts of parameter passing, the formal parameters can both be read and set +// (i.e. get new values being assigned) within the parametrized object. + +module Sem_050401_top_level_006 { + + type component GeneralComp { + } + + function f(inout integer p_int) { + p_int := 3; // setting p_int within parametrized content + if (p_int == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_006() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3edec4691a2bcd05ab377f99e44e312e0d9b018 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_007.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that in parameters can be used as actual in parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_007 { + + type component GeneralComp { + } + + template integer mw_range(in integer p_upperBound) := (0..p_upperBound); + + function f(in integer p_int) { + var template integer vm_t := mw_range(p_int); + log(vm_t); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_007() runs on GeneralComp { + f(5); + } + + control{ + execute(TC_Sem_050401_top_level_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..303e17d00e2addb83b7984987ec03a88f14d4b20 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_008.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that in parameters can be used as actual out parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_008 { + + type component GeneralComp { + } + + function fx(out integer p_int) { + p_int := 3; + } + + function f(in integer p_int) { + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_008() runs on GeneralComp { + f(5); + } + + control{ + execute(TC_Sem_050401_top_level_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c091f1f8dfcbdf65c4aba943c9ae35a537e45a09 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_009.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that in parameters can be used as actual inout parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_009 { + + type component GeneralComp { + } + + function fx(inout integer p_int) { + p_int := p_int + 3; + } + + function f(in integer p_int) { + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_009() runs on GeneralComp { + f(5); + } + + control{ + execute(TC_Sem_050401_top_level_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f0766bd78b04ddaba4a80e152c0917693dab3c4f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_010.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that out parameters can be used as actual in parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_010 { + + type component GeneralComp { + } + + template integer mw_range(in integer p_upperBound) := (0..p_upperBound); + + function f(out integer p_int) { + var template integer vm_t; + p_int := 5; + vm_t := mw_range(p_int); + log(vm_t); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_010() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_010()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5dd93869fa87469bfea7818ca968b39bc3276a2b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_011.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that out parameters can be used as actual out parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_011 { + + type component GeneralComp { + } + + function fx(out integer p_int) { + p_int := 3; + } + + function f(out integer p_int) { + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_011() runs on GeneralComp { + var integer v_int; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d9bb29e6dfb196150ad6d366a8f59f2bd61b49f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_012.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that out parameters can be used as actual inout parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_012 { + + type component GeneralComp { + } + + function fx(inout integer p_int) { + p_int := 3; + } + + function f(out integer p_int) { + p_int := 0; + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_012() runs on GeneralComp { + var integer v_int; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_012()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db676bdf2acd32e66ba5629422c72b8e22275042 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_013.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that inout parameters can be used as actual in parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_013 { + + type component GeneralComp { + } + + template integer mw_range(in integer p_upperBound) := (0..p_upperBound); + + function f(inout integer p_int) { + var template integer vm_t; + vm_t := mw_range(p_int); + log(vm_t); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_013() runs on GeneralComp { + var integer v_int := 5; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_013()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c465a3bc782180f35f3bd95e35c151cc313c5cc6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_014.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that inout parameters can be used as actual out parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_014 { + + type component GeneralComp { + } + + function fx(out integer p_int) { + p_int := 3; + } + + function f(inout integer p_int) { + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_014() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_014()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc8d90ef8d57ed8824a1525c6b175e6d54f15057 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_015.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that inout parameters can be used as actual inout parameters of parameterized objects + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal parameters can be used directly as actual parameters for other parametrized objects, +// e.g. as actual parameters in function invocations or as actual parameters in template instances. + +module Sem_050401_top_level_015 { + + type component GeneralComp { + } + + function fx(inout integer p_int) { + p_int := 3; + } + + function f(inout integer p_int) { + fx(p_int); + setverdict(pass); + } + + testcase TC_Sem_050401_top_level_015() runs on GeneralComp { + var integer v_int := 0; + f(v_int); + } + + control{ + execute(TC_Sem_050401_top_level_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..161ceb8773f5f1dbf5d3ddcee12fa63945ca3075 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_016.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.1, verify that compatibility rules are used for passing in parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If parameters are passed by value (i.e. in case of in and out parameters), type compatibility +// rules specified in 6.3 apply. + +module Sem_050401_top_level_016 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer option1, + integer option2 + } + + function f(R2 p_rec) { + if (match(p_rec, {1, 2})) { setverdict(pass); } + else { setverdict(fail, "p_rec value not matching ", p_rec, R2:{1, 2}); } + } + + testcase TC_Sem_050401_top_level_016() runs on GeneralComp { + var R1 v_rec := { field1 := 1, field2 := 2 }; + f(v_rec); + } + + control{ + execute(TC_Sem_050401_top_level_016()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05f031754f5a402071b05a2ad755103ac5afece7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_017.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.1, verify that compatibility rules are used for passing out parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If parameters are passed by value (i.e. in case of in and out parameters), type compatibility +// rules specified in 6.3 apply. + +module Sem_050401_top_level_017 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer option1, + integer option2 + } + + function f(out R2 p_rec) { + p_rec.option1 := 1; + p_rec.option2 := 2; + } + + testcase TC_Sem_050401_top_level_017() runs on GeneralComp { + var R1 v_rec; + f(v_rec); + if (match(v_rec, {1, 2})) { setverdict(pass); } + else { setverdict(fail, "v_rec value not matching ", v_rec, R1:{1, 2}); } + } + + control{ + execute(TC_Sem_050401_top_level_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3547a28b0365e04e2cdb0fc1348d64eca0f0439d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_018.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.1, verify that strong typing is used for passing inout parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When parameters are passed by reference, strong typing is required. Both the actual and formal +// parameter shall be of the same type. + +module Sem_050401_top_level_018 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + function f(inout R1 p_rec) { + if (match(p_rec, {1, 2})) { setverdict(pass); } + else { setverdict(fail, "p_rec value not matching ", p_rec, R1:{1, 2}); } + } + + testcase TC_Sem_050401_top_level_018() runs on GeneralComp { + var R1 v_rec := { field1 := 1, field2 := 2 }; + f(v_rec); + } + + control{ + execute(TC_Sem_050401_top_level_018()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97a838d53e8b82eed5f53ceef63ddb29c9092aca --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_019.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @lazy modifier can be used for value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared lazy using the @lazy modifier. The behaviour +// of lazy parameters is defined in clause 3.1, definition of lazy values or templates. + +module Sem_050401_top_level_019 { + + type component GeneralComp { + } + + function f(@lazy integer p_int) { + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_019() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_019()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_020.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..496719379ff6c4617d04b3ff02e45bfbcf49b843 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_020.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @lazy modifier can be used for template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared lazy using the @lazy modifier. The behaviour +// of lazy parameters is defined in clause 3.1, definition of lazy values or templates. + +module Sem_050401_top_level_020 { + + type component GeneralComp { + } + + function f(template @lazy integer pm_int) { + if (match(1, pm_int)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_020() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_020()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_021.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60c18b8b7fca6fda315930ef82f70b0cfc85c443 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_021.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @lazy parameters containing component variable references are properly evaluated + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared lazy using the @lazy modifier. The behaviour +// of lazy parameters is defined in clause 3.1, definition of lazy values or templates. + +// Note: the test checks the situation described in NOTE 2: +// The actual values of component variables used in the delayed evaluation of a lazy or fuzzy parameter +// may differ from their values at the time, when the parameterized function or alstep was called. + +module Sem_050401_top_level_021 { + + type component GeneralComp { + var integer vc_int := 20; + } + + function f(@lazy integer p_int) runs on GeneralComp { + vc_int := 0; + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_021() runs on GeneralComp { + f(vc_int + 1); + } + + control{ + execute(TC_Sem_050401_top_level_021()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_022.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26bb7f1f95971190d1b2d3d794528335c1beb533 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_022.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @fuzzy modifier can be used for value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared fuzzy using the @fuzzy modifier. The behaviour +// of fuzzy parameters is defined in clause 3.1, definition of fuzzy values or templates. + +module Sem_050401_top_level_022 { + + type component GeneralComp { + } + + function f(@fuzzy integer p_int) { + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_022() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_022()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_023.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b8565fd3e997ab75c441b9f3d56c953a9e9b745 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_023.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @fuzzy modifier can be used for template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared fuzzy using the @fuzzy modifier. The behaviour +// of fuzzy parameters is defined in clause 3.1, definition of fuzzy values or templates. + +module Sem_050401_top_level_023 { + + type component GeneralComp { + } + + function f(template @fuzzy integer pm_int) { + if (match(1, pm_int)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_023() runs on GeneralComp { + f(1); + } + + control{ + execute(TC_Sem_050401_top_level_023()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_024.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..137b624206fa132f79d5d122bd364d9f5c6dc196 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_024.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that @fuzzy parameters containing component variable references are properly evaluated + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Formal value or template parameters may be declared fuzzy using the @fuzzy modifier. The behaviour +// of fuzzy parameters is defined in clause 3.1, definition of fuzzy values or templates. + +// Note: the test checks the situation described in NOTE 2: +// The actual values of component variables used in the delayed evaluation of a lazy or fuzzy parameter +// may differ from their values at the time, when the parameterized function or alstep was called. + +module Sem_050401_top_level_024 { + + type component GeneralComp { + var integer vc_int := 20; + } + + function f(@fuzzy integer p_int) runs on GeneralComp { + vc_int := 0; + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_024() runs on GeneralComp { + f(vc_int + 1); + } + + control{ + execute(TC_Sem_050401_top_level_024()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_025.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a739ccf1353a4edd6340abeeb5613aec6025083 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_025.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that default values of @lazy parameters are properly evaluated + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Assigning default values for lazy and fuzzy formal parameters does not change the parameters' semantics: +// when the default values are used as actual values for the parameters, they shall be evaluated the same +// way (i.e. delayed) as if an actual parameter was provided. + +module Sem_050401_top_level_025 { + + type component GeneralComp { + } + + function f(@lazy float p_int := rnd()) runs on GeneralComp { + var float v_float; + // rnd function is used for checking: + // 1. first rnd with a seed is called to initiate the generator with a fixed value + // 2. the next call is without a seed (to continue the sequence); this value is saved + // 3. the third call re-uses the seed to restart the sequence + // 4. the rnd call used in evaluation of the default value shall produce the same result now as in the 2nd step + rnd(1.0); + v_float := rnd(); + rnd(1.0); + if (p_int == v_float) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_025() runs on GeneralComp { + f(); + } + + control{ + execute(TC_Sem_050401_top_level_025()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_026.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2186d59e14124722ba06585607c2f02c548c70cc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_026.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that default values of @fuzzy parameters are properly evaluated + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Assigning default values for lazy and fuzzy formal parameters does not change the parameters' semantics: +// when the default values are used as actual values for the parameters, they shall be evaluated the same +// way (i.e. delayed) as if an actual parameter was provided. + +module Sem_050401_top_level_026 { + + type component GeneralComp { + } + + function f(@fuzzy float p_int := rnd()) runs on GeneralComp { + var float v_float; + // rnd function is used for checking: + // 1. first rnd with a seed is called to initiate the generator with a fixed value + // 2. the next call is without a seed (to continue the sequence); this value is saved + // 3. the third call re-uses the seed to restart the sequence + // 4. the rnd call used in evaluation of the default value shall produce the same result now as in the 2nd step + rnd(1.0); + v_float := rnd(); + rnd(1.0); + if (p_int == v_float) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050401_top_level_026() runs on GeneralComp { + f(); + } + + control{ + execute(TC_Sem_050401_top_level_026()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_027.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9ccb2db2042900d4c01e799ddd027958f852aa5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_027.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that passing lazy parameter to formal parameter without modifier disables lazy evaluation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Lazy and fuzzy properties are valid only in the scope, where the parameters' names are visible. +// For example, if a fuzzy parameter is passed to a formal parameter declared without a modifier, it +// loses its fuzzy feature inside the called function. Similarly, if it is passed to a lazy formal +// parameter, it becomes lazy within the called function. + +module Sem_050401_top_level_027 { + + type component GeneralComp { + var integer vc_int := 20; + } + + function fx(integer p_int) runs on GeneralComp { + vc_int := 0; // doesn't have effect on the parameter value anymore as the parameter is not lazy + if (p_int == 21) { setverdict(pass); } + else { setverdict(fail); } + } + function f(@lazy integer p_int) runs on GeneralComp { + fx(p_int); // causes evaluation of the value + } + + testcase TC_Sem_050401_top_level_027() runs on GeneralComp { + f(vc_int + 1); // vc_int is equal to 20 at the time of function call + } + + control{ + execute(TC_Sem_050401_top_level_027()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_028.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..011051ba807dd3f92c5aa638913dc4906794bd7d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_028.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that passing fuzzy parameter to formal parameter without modifier disables fuzzy evaluation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Lazy and fuzzy properties are valid only in the scope, where the parameters' names are visible. +// For example, if a fuzzy parameter is passed to a formal parameter declared without a modifier, it +// loses its fuzzy feature inside the called function. Similarly, if it is passed to a lazy formal +// parameter, it becomes lazy within the called function. + +module Sem_050401_top_level_028 { + + type component GeneralComp { + var integer vc_int := 20; + } + + function fx(integer p_int) runs on GeneralComp { + vc_int := 0; // doesn't have effect on the parameter value anymore as the parameter is not lazy + if (p_int == 21) { setverdict(pass); } + else { setverdict(fail); } + } + function f(@fuzzy integer p_int) runs on GeneralComp { + fx(p_int); // causes evaluation of the value + } + + testcase TC_Sem_050401_top_level_028() runs on GeneralComp { + f(vc_int + 1); // vc_int is equal to 20 at the time of function call + } + + control{ + execute(TC_Sem_050401_top_level_028()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_029.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c9e203af3483e4ad34b0fe37f84e3a06cab566e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/050401_top_level/Sem_050401_top_level_029.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.1, verify that fuzzy parameter passed to lazy formal parameter enables lazy evaluation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Lazy and fuzzy properties are valid only in the scope, where the parameters' names are visible. +// For example, if a fuzzy parameter is passed to a formal parameter declared without a modifier, it +// loses its fuzzy feature inside the called function. Similarly, if it is passed to a lazy formal +// parameter, it becomes lazy within the called function. + +module Sem_050401_top_level_029 { + + type component GeneralComp { + var integer vc_int := 20; + } + + function fx(@lazy integer p_int) runs on GeneralComp { + vc_int := 0; // p_int hasn't been evaluated yet - this change will have impact on evaluation + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + vc_int := 10; // no impact on p_int value as the parameter has been already evaluated + if (p_int == 1) { setverdict(pass); } + else { setverdict(fail); } + } + function f(@fuzzy integer p_int) runs on GeneralComp { + fx(p_int); // no evaluation of the value yet + } + + testcase TC_Sem_050401_top_level_029() runs on GeneralComp { + f(vc_int + 1); // vc_int is equal to 20 at the time of function call + } + + control{ + execute(TC_Sem_050401_top_level_029()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23fe8bd551168d569b1d02f62f5f25b7cdaa5db8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff69a38e6be4a656a09c68860a573bdfef54fecc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0af9680377856dc8af983673ab28f60deb379c56 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f557ab159562acf9406125ab564206b6be3081d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4f70a9aa083dcd4d99b09c15840998930a2123d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa2852434355cb68c2187859c553cd8b5a79282c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_006.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @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 templates + ** @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_006 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + template integer m_test(in integer p_val) := 5 + p_val; + + testcase TC_NegSem_050402_actual_parameters_006() runs on GeneralComp { + if (match(6, m_test(m_msg))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_050402_actual_parameters_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5156778e312594403617945b8941c9359e0d0825 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @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 templates + ** @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_007 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 5 + p_val; + + testcase TC_NegSem_050402_actual_parameters_007() runs on GeneralComp { + var template integer vm_msg := 2; + if (match(7, m_test(vm_msg))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_050402_actual_parameters_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc2194e017b794071b0bc5e9a5cd6107bff5d92a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @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 templates + ** @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_008 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 5 + p_val; + + function f_caller(in template integer p_val) { + if (match(8, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_NegSem_050402_actual_parameters_008() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0913be2728439bf1d881f0cf365552a8c2da281a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_009.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @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 templates + ** @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_009 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 5 + p_val; + + 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 + if (match(9, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_NegSem_050402_actual_parameters_009() 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_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66a31dd9ce18709697e48d1579bb766e317fd10e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_010.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @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 templates + ** @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_010 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 5 + p_val; + + function f_caller(inout template integer p_val) { + if (match(10, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_NegSem_050402_actual_parameters_010() 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_010()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..638b29b5d51a1787b6bb0d9766f6fcd4f4daefaf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_011.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @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 altsteps + ** @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_011 { + + type component GeneralComp { + timer t := 0.0; + } + + template integer m_msg := 1; + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_011() runs on GeneralComp { + t.start; + a_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37a91024f52d82ba1af0c65d623d1bc43d5c5449 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_012.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @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 altsteps + ** @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_012 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_012() runs on GeneralComp { + var template integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_012()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..371fc0864875f2a439340ffcbf5bcb0ed45aa7b6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_013.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @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 altsteps + ** @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_013 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_013() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_013()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2f7362d8826b90e13bfeb0039e7a4f1b755117b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_014.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @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 altsteps + ** @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_014 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out template integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_014() runs on GeneralComp { + var template integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_014()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82f1485bdbb84dcf588d28c8889aa202ff0d12c3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_015.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @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 altsteps + ** @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_015 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_015() runs on GeneralComp { + var template integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c960fc52306c4e865f283d69529b8569c7ad565f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_016.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @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 test cases + ** @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_016 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + testcase TC_NegSem_050402_actual_parameters_016(in integer p_val) runs on GeneralComp { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_016(m_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..354fe092ed945cc310b7f1b942835002af4794bd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_017.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @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 test cases + ** @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_017 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_017(in integer p_val) runs on GeneralComp { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template integer vm_msg := 2; + execute(TC_NegSem_050402_actual_parameters_017(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d815a929eca206d474d01c7c46c41680b25a257c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_018.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @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 test cases + ** @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_018 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_018(in integer p_val) runs on GeneralComp { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + execute(TC_NegSem_050402_actual_parameters_018(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa2d9a2891c5cbbc0bce1f04831e6d060eb5dee7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_019.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @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 test cases + ** @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_019 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_019(in integer p_val) runs on GeneralComp { + 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 + execute(TC_NegSem_050402_actual_parameters_019(p_val)); // tested parameter passing + } + + control { + var template integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_020.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2555fef724eb6c35ce115dcbbe0b89e942346c0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_020.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @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 test cases + ** @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_020 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_020(in integer p_val) runs on GeneralComp { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + execute(TC_NegSem_050402_actual_parameters_020(p_val)); // tested parameter passing + } + + control { + var template integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_021.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17f107d6d291e124fa954c954036b2fda35bb443 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_021.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_021 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_021() runs on GeneralComp { + f_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_021()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_022.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e3c5fd32bb562fd0f34288bbc48749af24b81e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_022.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_022 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(inout integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_022() runs on GeneralComp { + f_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_022()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_023.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..875e14b70ed115d81cf3efad6ea671aa79b2cd99 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_023.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_023 { + + type component GeneralComp { + } + + const integer c_val := 3; + + function f_test(inout integer p_val) { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_023() runs on GeneralComp { + f_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_023()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_024.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76e596bf2405a2cfd44e076aa61a6dd05bdce324 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_024.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_024 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + function f_test(inout integer p_val) { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_024() runs on GeneralComp { + f_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_024()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_025.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46e231cb6622c125a517269ecf54dc63ec5fe2f5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_025.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_025 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(inout integer p_val) { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_025() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_025()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_026.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe08fbf0b776ca069701f1cf4cd58e60bf5d58fb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_026.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_026 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + function f_test(inout integer p_val) { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_026() runs on GeneralComp { + f_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_026()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_027.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b5059bb21e189928687a73c042bf7da6f1082742 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_027.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_027 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_027() runs on GeneralComp { + var template integer vm_msg := 2; + f_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_027()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_028.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..77b5ada91123578a5739a26735b122a20e00877b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_028.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_028 { + + type component GeneralComp { + } + + function f_test(inout 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_028() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_028()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_029.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bf8fecb4d770d012ae325f586a7ed8728d610a2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_029.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_029 { + + type component GeneralComp { + } + + function f_test(inout 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_029() 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_029()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_030.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61383d58bce243766038f255f2bc035a4a533da4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_030.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_030 { + + 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_030() 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_030()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_031.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b92e1fceb8442e2c3f392f10532ce12290586f3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_031.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variable element reference cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_031 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout integer p_val) { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_031() runs on GeneralComp { + var template R v_val := { field1 := 10 }; + f_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_031()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_032.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a66339e85f4a1ab096eca91c29f7cbb24dce6bb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_032.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_032 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout integer p_val) { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template R p_param) { + f_test(p_param.field1); // tested parameter passing + } + + testcase TC_NegSem_050402_actual_parameters_032() runs on GeneralComp { + f_caller({field1 := 11 }); + } + + control { + execute(TC_NegSem_050402_actual_parameters_032()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_033.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f7e1bdb933679457446f7f20d5c23a8f6762655 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_033.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_033 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_033() runs on GeneralComp { + t.start; + a_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_033()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_034.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51f663e2fd6289af1fe25f0e36b7f433d88763b5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_034.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_034 { + + type component GeneralComp { + timer t := 0.0; + } + + modulepar integer PX_VAL := 2; + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_034() runs on GeneralComp { + t.start; + a_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_034()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_035.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75e3cc62def68b0252006aa060ff71cc065e8588 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_035.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_035 { + + type component GeneralComp { + timer t := 0.0; + } + + const integer c_val := 3; + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_035() runs on GeneralComp { + t.start; + a_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_035()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_036.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..631b20ff5cb5bbea1dac570c4886119bf0ff0d27 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_036.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_036 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 5; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_036() runs on GeneralComp { + t.start; + a_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_036()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_037.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ddd75ee7a9756a3867d58025333c8980d4c46ed --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_037.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_037 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 4; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_037() runs on GeneralComp { + var integer v_val := 5; + t.start; + a_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_037()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_038.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca9dbefab18628e0511dde2073c03207bede58d3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_038.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_038 { + + type component GeneralComp { + timer t := 0.0; + } + + template integer m_msg := 1; + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_038() runs on GeneralComp { + t.start; + a_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_038()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_039.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6895f59b9903580ccb3f472a912d552cbf5f1c4b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_039.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_039 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_039() runs on GeneralComp { + var template integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_039()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_040.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7effbefe1a5d7b11b2b27bb90ad566ea01cecf49 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_040.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types.. + +module NegSem_050402_actual_parameters_040 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_040() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_040()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_041.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..467890d5e8e996a2c14216f3ba6cff6a185da78b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_041.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_041 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out template integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_041() runs on GeneralComp { + var template integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_041()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_042.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f98a263e3c8c24c103bec04a931ce8ec7b59bf7b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_042.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_042 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_NegSem_050402_actual_parameters_042() runs on GeneralComp { + var template integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_042()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_043.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b867cf8066b31db800a7351042f6ca0421542bcc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_043.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variable element reference cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_043 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_043() runs on GeneralComp { + var template R v_val := { field1 := 10 }; + t.start; + a_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_043()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_044.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2ab835bcd961a96a0abb59507648fd9a4a783a0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_044.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as inout formal value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_044 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template R p_param) runs on GeneralComp { + a_test(p_param.field1); // tested parameter passing + } + + testcase TC_NegSem_050402_actual_parameters_044() runs on GeneralComp { + t.start; + f_caller({field1 := 11 }); + } + + control { + execute(TC_NegSem_050402_actual_parameters_044()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_045.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e9d6e1203740e056175a2a20ddd15f042f074de --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_045.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_045 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_045(inout integer p_val) runs on GeneralComp { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_045(1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_046.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f376942467d719d8a8284c5576e572ac16aafce5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_046.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_046 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + testcase TC_NegSem_050402_actual_parameters_046(inout integer p_val) runs on GeneralComp { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_046(PX_VAL)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_047.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6bb3aebe8c384a9f7063f9fb3dc7f5b6b9c960e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_047.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_047 { + + type component GeneralComp { + } + + const integer c_val := 3; + + testcase TC_NegSem_050402_actual_parameters_047(inout integer p_val) runs on GeneralComp { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_047(c_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_048.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9133f269a05b2c6d4d8c260db1199615f9c7bd18 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_048.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_048 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + testcase TC_NegSem_050402_actual_parameters_048(inout integer p_val) runs on GeneralComp { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_048(f_ret())); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_049.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c0e44c11295609fb9b70b72db2b18e6998a7a0c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_049.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_049 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + testcase TC_NegSem_050402_actual_parameters_049(inout integer p_val) runs on GeneralComp { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 5; + execute(TC_NegSem_050402_actual_parameters_049(10 + f_ret() - v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_050.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb2255d2cf14b268922ff54796ee8e2eefe5674d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_050.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_050 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + testcase TC_NegSem_050402_actual_parameters_050(inout integer p_val) runs on GeneralComp { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_050(m_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_051.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b972a1c7a49793ff090b8008ef622ebfdda0631 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_051.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. +module NegSem_050402_actual_parameters_051 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_051(inout integer p_val) runs on GeneralComp { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template integer vm_msg := 2; + execute(TC_NegSem_050402_actual_parameters_051(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_052.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87fd26c1eac3f8bbb8293905d5d1c452a6b699bb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_052.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_052 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_052(inout integer p_val) runs on GeneralComp { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + execute(TC_NegSem_050402_actual_parameters_052(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_053.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..efd7cce4328048f2ff03bf3ec45eae19e6dd7f04 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_053.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_053 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_053(inout integer p_val) runs on GeneralComp { + 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 + execute(TC_NegSem_050402_actual_parameters_053(p_val)); // tested parameter passing + } + + control { + var template integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_054.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..457e34a959d33e66f4fbd106f510ac83c90287e3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_054.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_054 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_054(inout integer p_val) runs on GeneralComp { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + execute(TC_NegSem_050402_actual_parameters_054(p_val)); // tested parameter passing + } + + control { + var template integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_055.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdf3f20e91587fc1fbb02c29d82617fe043d52f1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_055.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variable element reference cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_055 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_NegSem_050402_actual_parameters_055(inout integer p_val) runs on GeneralComp { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template R v_val := { field1 := 10 }; + execute(TC_NegSem_050402_actual_parameters_055(v_val.field1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_056.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c00f537edd27a60fbee7b5b5cf290996c4e430d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_056.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as inout formal value parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module NegSem_050402_actual_parameters_056 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_NegSem_050402_actual_parameters_056(inout integer p_val) runs on GeneralComp { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template R p_param) { + execute(TC_NegSem_050402_actual_parameters_056(p_param.field1)); // tested parameter passing + } + + control { + f_caller({field1 := 11 }); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_057.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2773b8e6bb3a3c47534ec60f1c10bdf1aa358996 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_057.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that literals cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_057 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_057() runs on GeneralComp { + f_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_057()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_058.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfd1dbb0e37b3c6288b31bdf668c76939721163b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_058.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_058 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_058() runs on GeneralComp { + f_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_058()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_059.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15cdf62d110ffafd5ccc37bd49c846c9b6e0158a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_059.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that constants cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_059 { + + type component GeneralComp { + } + + const integer c_val := 3; + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_059() runs on GeneralComp { + f_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_059()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_060.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ed380f55fbe905ccb992469c225485a41f21a5c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_060.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that function calls cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_060 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_060() runs on GeneralComp { + f_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_060()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_061.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8485d5d8548a77d51b8ee29f8677776d46b35753 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_061.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that expressions cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_061 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_061() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_061()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_062.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07bcce3ededba8b767048a908856f2aac915753b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_062.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_062 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + function f_test(out template integer p_val) { + p_val := ?; + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_062() runs on GeneralComp { + f_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_062()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_063.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff41b229db587342de336a7b8103e875cffa63b8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_063.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that literals cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_063 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_063() runs on GeneralComp { + t.start; + a_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_063()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_064.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c92507a2e177913eeb998c9c692adbd359a2b6c0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_064.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_064 { + + type component GeneralComp { + timer t := 0.0; + } + + modulepar integer PX_VAL := 2; + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_064() runs on GeneralComp { + t.start; + a_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_064()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_065.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa486db03017912f2cd3d8cb427ca9e0a716848f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_065.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that constants cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_065 { + + type component GeneralComp { + timer t := 0.0; + } + + const integer c_val := 3; + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_065() runs on GeneralComp { + t.start; + a_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_065()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_066.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4881bc029762eb7ecfbe6cf2a506a7c9f0a6253 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_066.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that function calls cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_066 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 5; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_066() runs on GeneralComp { + t.start; + a_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_066()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_067.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e874a0546da59f4b0f484e8808c02aa9470e7f9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_067.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that expressions cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_067 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 4; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_067() runs on GeneralComp { + var integer v_val := 5; + t.start; + a_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_067()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_068.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3d3700ce3c6139c9887869067ab11e45b0d8bea --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_068.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_068 { + + type component GeneralComp { + timer t := 0.0; + } + + template integer m_msg := 1; + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := ?; + setverdict(pass); + } + } + + testcase TC_NegSem_050402_actual_parameters_068() runs on GeneralComp { + t.start; + a_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_068()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_069.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb09382513f8161653c7700e414f5d25a31d279e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_069.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that literals cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_069 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_069(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_069(1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_070.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b384568ffb8703c81ffa050dcf13a3aa680f2f9d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_070.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_070 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + testcase TC_NegSem_050402_actual_parameters_070(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_070(PX_VAL)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_071.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e8fd39bdd2f8959fd56468f9ed8c1e6c69d1849 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_071.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that constants cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_071 { + + type component GeneralComp { + } + + const integer c_val := 3; + + testcase TC_NegSem_050402_actual_parameters_071(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_071(c_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_072.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b06b730191b1ce02f97498d0cef965fdd751bb2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_072.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that function calls cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_072 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + testcase TC_NegSem_050402_actual_parameters_072(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_072(f_ret())); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_073.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e006e0928210bd0cc43b6b37a335b2e7461bb34 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_073.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that expressions cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_073 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + testcase TC_NegSem_050402_actual_parameters_073(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + var integer v_val := 5; + execute(TC_NegSem_050402_actual_parameters_073(10 + f_ret() - v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_074.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7710fd283f0d3b10f2bb7a06fd394ea05c22a425 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_074.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_074 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + testcase TC_NegSem_050402_actual_parameters_074(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_074(m_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_075.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e89b0303202e65ddaa00d1883085fcf93d79a169 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_075.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_075 { + + type component GeneralComp { + } + + function f_test(inout template integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_075() runs on GeneralComp { + f_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_075()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_076.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2e65880aa3bd877c96f3f62f924888b164651e6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_076.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_076 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(inout template integer p_val) { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_076() runs on GeneralComp { + f_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_076()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_077.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31321a4b2855360c95ed02018d9981aef0d00436 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_077.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_077 { + + type component GeneralComp { + } + + const integer c_val := 3; + + function f_test(inout template integer p_val) { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_077() runs on GeneralComp { + f_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_077()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_078.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ced909e8efb412036678ddd586cc3f97ef53470e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_078.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_078 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + function f_test(inout template integer p_val) { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_078() runs on GeneralComp { + f_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_078()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_079.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..11690ad6a3a94d98655274cddfa47d6ad5a364f5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_079.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_079 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(inout template integer p_val) { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_079() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_079()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_080.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02681b64f9472481c12ae53322c9d5bb69b41fc4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_080.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_080 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + function f_test(inout template integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_080() runs on GeneralComp { + f_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_080()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_081.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..056d07996b7bee064ecd8640847bb95b9fdb3d3e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_081.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. +module NegSem_050402_actual_parameters_081 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_081() runs on GeneralComp { + t.start; + a_test(1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_081()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_082.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb294849ab0c7ef27c911bde1eae8f2658e30b79 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_082.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. +module NegSem_050402_actual_parameters_082 { + + type component GeneralComp { + timer t := 0.0; + } + + modulepar integer PX_VAL := 2; + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_082() runs on GeneralComp { + t.start; + a_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_082()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_083.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92a7912565684b20aa7ddcdd0ef47443081837b5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_083.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_083 { + + type component GeneralComp { + timer t := 0.0; + } + + const integer c_val := 3; + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_083() runs on GeneralComp { + t.start; + a_test(c_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_083()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_084.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cd3597eeab3d3ac8ba7dd975a877ae5a70db38c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_084.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_084 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 5; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_084() runs on GeneralComp { + t.start; + a_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_084()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_085.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ae961e04085b4306ce98f96bf205bc23220defe --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_085.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_085 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 4; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_085() runs on GeneralComp { + var integer v_val := 5; + t.start; + a_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_085()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_086.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88784e28c5a2c0483f18b4a3bbe3957944f817e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_086.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value parameters, formal template parameters or references +// to elements of variables, template variables, formal value parameters or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_086 { + + type component GeneralComp { + timer t := 0.0; + } + + template integer m_msg := 1; + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_086() runs on GeneralComp { + t.start; + a_test(m_msg); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_086()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_087.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..081f064a73db22f2102cef1cc555657f0a59390c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_087.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_087 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_087(inout template integer p_val) runs on GeneralComp { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_087(1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_088.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dbc74eccf81d205ca7bf2d235241046fbc89a88c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_088.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_088 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + testcase TC_NegSem_050402_actual_parameters_088(inout template integer p_val) runs on GeneralComp { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_088(PX_VAL)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_089.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..052c6031d918ff502a4391112c868a262c24e0e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_089.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_089 { + + type component GeneralComp { + } + + const integer c_val := 3; + + testcase TC_NegSem_050402_actual_parameters_089(inout template integer p_val) runs on GeneralComp { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_089(c_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_090.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a90ee42b98fa3306d28e2c6758f69355b8072c2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_090.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_090 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + testcase TC_NegSem_050402_actual_parameters_090(inout template integer p_val) runs on GeneralComp { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_090(f_ret())); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_091.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_091.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ee56b09d6326c974063dccf6c8030f96a946961 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_091.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_091 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + testcase TC_NegSem_050402_actual_parameters_091(inout template integer p_val) runs on GeneralComp { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 5; + execute(TC_NegSem_050402_actual_parameters_091(10 + f_ret() - v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_092.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_092.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99883dbbcb4547c72b976e32645b24bd4cad65d4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_092.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters cannot be used as inout formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module NegSem_050402_actual_parameters_092 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + testcase TC_NegSem_050402_actual_parameters_092(inout template integer p_val) runs on GeneralComp { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_092(m_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_093.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_093.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d4ef1aea7bde8d098f7a19c994563e70932af7c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_093.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing errors are detected in actual parameters passed to in formal value parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to in formal value or template parameters +// contain a value or template reference, rules for using references on the right hand +// side of assignments apply. + +module NegSem_050402_actual_parameters_093 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(in integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_093() runs on GeneralComp { + var R v_rec := { + field1 := 1, + field2 := omit + } + f_test(v_rec.field2.subfield1); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_093()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_094.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_094.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7522919f074c82c2edaa99953280580d2772ac24 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_094.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing errors are detected in actual parameters passed to in formal template parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to in formal value or template parameters +// contain a value or template reference, rules for using references on the right hand +// side of assignments apply. + +module NegSem_050402_actual_parameters_094 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + template R mw_rec := { + field1 := 1, + field2 := * + } + + function f_test(in template integer p_val) { + if (match(255, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_094() runs on GeneralComp { + f_test(mw_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + } + + control { + execute(TC_NegSem_050402_actual_parameters_094()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_095.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_095.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ece386e80b5e77259b4ad96797a5a1c71412d454 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_095.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing errors are detected in actual parameters passed to out formal template parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module NegSem_050402_actual_parameters_095 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(out template integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_095() runs on GeneralComp { + var template R v_rec := { + field1 := 1, + field2 := ({ subfield1 := 0, subfield2 := 1}, { subfield1 := 2, subfield2 := 3 }) + }; + f_test(v_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + if (valueof(v_rec.field2.subfield1) == 10 and match(0, v_rec.field2.subfield2)) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_NegSem_050402_actual_parameters_095()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_096.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_096.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9db9d6c2b2cabc1f82308422608ec17800539d7b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_096.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of inout formal template parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module NegSem_050402_actual_parameters_096 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(inout template integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_096() runs on GeneralComp { + var template R v_rec := { + field1 := 1, + field2 := ({ subfield1 := 0, subfield2 := 1}, { subfield1 := 2, subfield2 := 3 }) + }; + // expected error since v_rec.field2.subfield1 not defined since v_rec.field2 is not *, ? or omit (see expansion rules) + f_test(v_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + log(v_rec); + if (valueof(v_rec.field2.subfield1) == 10 and match(0, v_rec.field2.subfield2)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_096()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_097.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_097.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1a054b6e617429dba64f10c32627d117610d7a2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_097.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that string item references cannot be used as inout formal value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. +// (see also the NOTE from 5.4.2) + +module NegSem_050402_actual_parameters_097 { + + type component GeneralComp { + } + + function f_test(inout charstring p_val) { + if (p_val == "t") { setverdict(pass); } + else { setverdict(fail); } + p_val := "r"; + } + + testcase TC_NegSem_050402_actual_parameters_097() runs on GeneralComp { + var charstring v_val := "test"; + f_test(v_val[0]); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_097()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_098.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_098.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..036981bf7ffb3922fc77b88a8541d1c96407b80c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_098.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that ordinary values cannot be passed to timer parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal timer parameters shall be component +// timers, local timers or formal timer parameters of the current scope. + +module NegSem_050402_actual_parameters_098 { + + type component GeneralComp { + } + + function f_test(timer t_par) { + t_par.start; + if (t_par.running) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_098() runs on GeneralComp { + f_test(5.0); // tested parameter passing: it should not be possible to pass a float value to a timer parameter + } + + control { + execute(TC_NegSem_050402_actual_parameters_098()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_099.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_099.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d3d6c7a988a57192c4f20c1d56cf03f5f879eb0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_099.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that values cannot be passed to port parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal port parameters shall be component +// ports or formal port parameters of the current scope. + +module NegSem_050402_actual_parameters_099 { + + type port IntPort message { + inout integer; + } + + type component GeneralComp { + port IntPort p; + } + + function f_test(IntPort p_port) { + p_port.stop; + } + + testcase TC_NegSem_050402_actual_parameters_099() runs on GeneralComp { + var integer v_val := 5; + f_test(v_val); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_099()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_100.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_100.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..edddd11f934502692ee64dffbc0ac424f3e70e53 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_100.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @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 ( match(p_val1, 1) and match(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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_101.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_101.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea560b78cd23e4d77d72c674d80005dacc1b0832 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_101.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_102.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_102.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa4e330d401dffecb51a19ff3903ee6b14d7b80a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_102.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa5ac9db25552e7072d4ac10030e8732cc24a496 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_103.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @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 ( match(p_val1, 1) and match(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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3dee3cda1b33dcda5c56efeb155f20203bc4338 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_104.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @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 ( match(p_val1, 1) and match(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()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_105.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_105.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f0a39a1ff705847749668b29393a30c5a3a9025 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_105.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that parameters cannot be assigned more than once in assignment notation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When using assignment notation, each formal parameter shall be assigned an actual +// parameter at most once. + +module NegSem_050402_actual_parameters_105 { + + type component GeneralComp { + } + + function f_test (integer p_val1, charstring p_val2) { + if (match(p_val1 == 1 and p_val2 == "test") { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_105() runs on GeneralComp { + f_test(p_val1 := 1, p_val2 := "test", p_val1 := 1); + } + + control { + execute(TC_NegSem_050402_actual_parameters_105()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_106.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_106.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0f5c8d7f7b7775a5d077ccf1aa2f4c841a4624d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_106.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that assignment notation that doesn't contain all parameters is not accepted + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For each formal parameter without default value, there shall be an actual parameter. + +module NegSem_050402_actual_parameters_106 { + + type component GeneralComp { + } + + function f_test (integer p_val1, charstring p_val2, integer p_val3) { + if (match(p_val1, 1) and match(p_val2, "test") and match(p_val3, 3)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_106() runs on GeneralComp { + f_test(p_val2 := "test", p_val3 := 3); + } + + control { + execute(TC_NegSem_050402_actual_parameters_106()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_107.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_107.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8934829aa178c2661cd3aec07a08231c96a34e5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_107.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that incompatible values cannot be passed to in formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The type of each actual parameter shall be compatible with the type of each +// corresponding formal parameter. + +module NegSem_050402_actual_parameters_107 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 + } + + type record R2 { + integer elem1, + integer elem2 optional + } + + function f_test (R1 p_val) { + if (p_val == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_107() runs on GeneralComp { + var R2 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_107()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_108.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_108.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..11c90612349d5bb8e87afe4bcd8459e4258a635b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_108.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that incompatible values cannot be passed from out formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The type of each actual parameter shall be compatible with the type of each +// corresponding formal parameter. + +module NegSem_050402_actual_parameters_108 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + type record R2 { + integer elem1, + integer elem2 + } + + function f_test (out R1 p_val) { + p_val.field1 := 1; + p_val.field2 := 2; + } + + testcase TC_NegSem_050402_actual_parameters_108() runs on GeneralComp { + var R2 v_rec; + f_test(v_rec); + if (v_rec == { elem1 := 1, elem2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_108()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_109.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_109.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9ee710c5a43fa9cce58786786077a103ff9c2d3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_109.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that incompatible values cannot be passed to inout formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Strong typing is required for parameters passed by reference. + +module NegSem_050402_actual_parameters_109 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + type record R2 { + integer elem1, + integer elem2 + } + + function f_test (inout R1 p_val) { + if (p_val == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_109() runs on GeneralComp { + var R2 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_109()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_110.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_110.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75bc2cafcf961f2ca119a92f745edd368d32aa06 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_110.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that values of compatible but distinct types cannot be passed to inout formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Strong typing is required for parameters passed by reference. + +module NegSem_050402_actual_parameters_110 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + type R1 R2; + + function f_test (inout R1 p_val) { + if (p_val == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_110() runs on GeneralComp { + var R2 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_110()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_111.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_111.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1121b96290327aaae98463404231899f5da5d1a0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_111.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that incompatible templates cannot be passed to template parameters with omit restriction + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module NegSem_050402_actual_parameters_111 { + + type component GeneralComp { + } + + function f_test (omit integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_111() runs on GeneralComp { + f_test((0..10)); + } + + control { + execute(TC_NegSem_050402_actual_parameters_111()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_112.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_112.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f69a5b73f086d655c0f712efbbcfc8bd426ea5a2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_112.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible templates can be passed to template parameters with value restriction + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module NegSem_050402_actual_parameters_112 { + + type component GeneralComp { + } + + function f_test (template(value) integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_112() runs on GeneralComp { + f_test((1, 2, 3)); + } + + control { + execute(TC_NegSem_050402_actual_parameters_112()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_113.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_113.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04ce15f14120290438cf12d030ead967e1a5ed53 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_113.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible templates can be passed to template parameters with present restriction + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module NegSem_050402_actual_parameters_113 { + + type component GeneralComp { + } + + function f_test (template(present) integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_113() runs on GeneralComp { + f_test(*); + } + + control { + execute(TC_NegSem_050402_actual_parameters_113()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_114.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_114.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d43d618c29ebcc139b7315546439f2342381f007 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_114.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that parametrized entities used as actual parameter cannot be passed without parameter list + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// All parameterized entities specified as an actual parameter shall have their +// own parameters resolved in the top-level actual parameter list. + +module NegSem_050402_actual_parameters_114 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + template R mw_rec(template integer p_field2) := { + field1 := 1, + field2 := p_field2 + } + + function f_test (template R p_match) { + if (match({1, omit}, p_match)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_114() runs on GeneralComp { + f_test(mw_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_114()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_115.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_115.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d43750b8805c575b2589bec2b77649e2b4451e2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_115.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when no actual parameter list is used for functions with no parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module NegSem_050402_actual_parameters_115 { + + type component GeneralComp { + } + + function f_test () return integer { + setverdict(pass); + return 1; + } + + testcase TC_NegSem_050402_actual_parameters_115() runs on GeneralComp { + log(f_test); + } + + control { + execute(TC_NegSem_050402_actual_parameters_115()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_116.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_116.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d32fe54b4bd145f843073c052925ec7c8e416d36 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_116.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when no actual parameter list is used for test cases with no parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module NegSem_050402_actual_parameters_116 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_116() runs on GeneralComp { + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_116); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_117.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_117.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37a31840f18aaaaf26c5162c9d2152af945ce892 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_117.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when no actual parameter list is used for altsteps with no parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module NegSem_050402_actual_parameters_117 { + + type component GeneralComp { + } + + altstep a_test () { + [] any timer.timeout { setverdict(pass); } + } + + testcase TC_NegSem_050402_actual_parameters_117() runs on GeneralComp { + timer t_instant := 0.0; + t_instant.start; + alt { + [] a_test { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_050402_actual_parameters_117()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_118.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_118.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41a13dc33e20c163fa458d9582cdbb8ba1dd3a0c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_118.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when empty actual parameter list is used for templates with no parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module NegSem_050402_actual_parameters_118 { + + type component GeneralComp { + } + + template integer mw_allInt := ?; + + testcase TC_NegSem_050402_actual_parameters_118() runs on GeneralComp { + if (match(1, mw_allInt())) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_118()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_119.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_119.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0af03a05f31fa312fef016afb99d2ffb364839f7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_119.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that uninitialized values cannot be passed to in formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Unless specified differently in the relevant clause(s), actual parameters +// passed to in or inout formal parameters shall be at least partially +// initialized (for an exemption see e.g. clause 16.1.2 of the present document). + +module NegSem_050402_actual_parameters_119 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + function f_test (R p_val) { + if (not isbound(p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_119() runs on GeneralComp { + var R v_rec; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_119()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_120.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_120.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7f578bf35da28e67dfc347a7eb85a4ffbb9dd32 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_120.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that uninitialized values cannot be passed to inout formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Unless specified differently in the relevant clause(s), actual parameters +// passed to in or inout formal parameters shall be at least partially +// initialized (for an exemption see e.g. clause 16.1.2 of the present document). + +module NegSem_050402_actual_parameters_120 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + function f_test (inout R p_val) { + if (not isbound(p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_120() runs on GeneralComp { + var R v_rec; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_120()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_121.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_121.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4da84e2e1ed2cec17839d3b885d92f592b8f196a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_121.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls passed to lazy formal parameters cannot contain inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Functions, called by actual parameters passed to fuzzy or lazy formal parameters +// of the calling function, shall not have inout or out formal parameters. The called +// functions may use other functions with inout or out parameters internally. + +module NegSem_050402_actual_parameters_121 { + + type component GeneralComp { + } + + function f_eval(inout integer p_val) return integer { + p_val := p_val + 1; + return p_val; + } + + function f_test (@lazy integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_121() runs on GeneralComp { + var integer v_val := 0; + f_test(1 + f_eval(v_val)); + } + + control { + execute(TC_NegSem_050402_actual_parameters_121()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_122.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_122.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e884218637468c8c5eed663e31f138a6c3607139 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_122.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls passed to fuzzy formal parameters cannot contain inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Functions, called by actual parameters passed to fuzzy or lazy formal parameters +// of the calling function, shall not have inout or out formal parameters. The called +// functions may use other functions with inout or out parameters internally. + +module NegSem_050402_actual_parameters_122 { + + type component GeneralComp { + } + + function f_eval(inout integer p_val) return integer { + p_val := p_val + 1; + return p_val; + } + + function f_test (@fuzzy integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_122() runs on GeneralComp { + var integer v_val := 0; + f_test(1 + f_eval(v_val)); + } + + control { + execute(TC_NegSem_050402_actual_parameters_122()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_123.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_123.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d3436fcae5a687b00f3816c2fd74d7ba8a09843 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_123.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls passed to lazy formal parameters cannot contain out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Functions, called by actual parameters passed to fuzzy or lazy formal parameters +// of the calling function, shall not have inout or out formal parameters. The called +// functions may use other functions with inout or out parameters internally. + +module NegSem_050402_actual_parameters_123 { + + type component GeneralComp { + } + + function f_eval(out integer p_val) return integer { + p_val := 10; + return 1; + } + + function f_test (@lazy integer p_val) { + if (p_val == 12) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_123() runs on GeneralComp { + var integer v_val := 0; + f_test(1 + f_eval(v_val) + v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_123()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_124.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_124.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60ee4eb8b27e4af5d9dbff5265245d35788af2bf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_124.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls passed to fuzzy formal parameters cannot contain out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Functions, called by actual parameters passed to fuzzy or lazy formal parameters +// of the calling function, shall not have inout or out formal parameters. The called +// functions may use other functions with inout or out parameters internally. + +module NegSem_050402_actual_parameters_124 { + + type component GeneralComp { + } + + function f_eval(out integer p_val) return integer { + p_val := 10; + return 1; + } + + function f_test (@fuzzy integer p_val) { + if (p_val == 12) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_124() runs on GeneralComp { + var integer v_val := 0; + f_test(1 + f_eval(v_val) + v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_124()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_125.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_125.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98ac82fc523d75eefc205650a37494d75e55236b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_125.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when lazy variable is passed to inout formal parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to out and inout parameters shall not be references to +// lazy or fuzzy variables. + +module NegSem_050402_actual_parameters_125 { + + type component GeneralComp { + } + + function f_test (inout integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_125() runs on GeneralComp { + var @lazy integer v_val := 1; + f_test(v_val); + if (v_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_125()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_126.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_126.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e85f4ac52c7d4801c640c3d573510b23cd7d0ef --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_126.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when fuzzy variable is passed to inout formal parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to out and inout parameters shall not be references to +// lazy or fuzzy variables. + +module NegSem_050402_actual_parameters_126 { + + type component GeneralComp { + } + + function f_test (inout integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_126() runs on GeneralComp { + var @fuzzy integer v_val := 1; + f_test(v_val); + if (v_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_126()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_127.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_127.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76cbabf1e247892248ec3a7bb15526952d15b0ea --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_127.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when lazy variable is passed to out formal parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to out and inout parameters shall not be references to +// lazy or fuzzy variables. + +module NegSem_050402_actual_parameters_127 { + + type component GeneralComp { + } + + function f_test (out integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_127() runs on GeneralComp { + var @lazy integer v_val := 1; + f_test(v_val); + if (v_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_127()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_128.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_128.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7b9fc5cb719a45eedb3ec69aa7cb8120dcef7b4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_128.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when fuzzy variable is passed to out formal parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to out and inout parameters shall not be references to +// lazy or fuzzy variables. + +module NegSem_050402_actual_parameters_128 { + + type component GeneralComp { + } + + function f_test (out integer p_val) { + p_val := 10; + } + + testcase TC_NegSem_050402_actual_parameters_128() runs on GeneralComp { + var @fuzzy integer v_val := 1; + f_test(v_val); + if (v_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_128()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_129.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_129.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c94cd328fb1362e75d2fd67f8f835bd517831613 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_129.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing record and its field to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_129 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test (inout integer p_val, inout R p_rec) { + p_rec.field1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_129() runs on GeneralComp { + var R v_val := { field1 := 1 }; + f_test(v_val.field1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_129()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_130.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_130.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eba2d3b24def8541d0ddf124fbedc5735328bd5c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_130.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing set and its field to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_130 { + + type component GeneralComp { + } + + type set S { + integer field1 + } + + function f_test (inout integer p_val, inout S p_set) { + p_set.field1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_130() runs on GeneralComp { + var S v_val := { field1 := 1 }; + f_test(v_val.field1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_130()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_131.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_131.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da99b5518b0a3340b3b11f5f528e9fef096adf0d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_131.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing union and its element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_131 { + + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + function f_test (inout integer p_val, inout U p_un) { + p_un.option1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_131() runs on GeneralComp { + var U v_val := { option1 := 1 }; + f_test(v_val.option1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_131()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_132.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_132.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..324e0170ee488e9fbe6cd679394553b0d89ccbf3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_132.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing record of and its element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_132 { + + type component GeneralComp { + } + + type record of integer RI; + + function f_test (inout integer p_val, inout RI p_rec) { + p_rec[0] := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_132() runs on GeneralComp { + var RI v_val := { 1 }; + f_test(v_val[0], v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_132()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_133.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_133.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..717b58a6cf4e862986a7e73e8222622e569c6130 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_133.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing set of and its element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_133 { + + type component GeneralComp { + } + + type set of integer SI; + + function f_test (inout integer p_val, inout SI p_set) { + p_set[0] := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_133() runs on GeneralComp { + var SI v_val := { 1 }; + f_test(v_val[0], v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_133()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_134.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_134.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c08f6654873202e917a7dd70d1850afbc88a9963 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_134.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing array and its element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_134 { + + type component GeneralComp { + } + + type integer A[2]; + + function f_test (inout integer p_val, inout A p_arr) { + p_arr[0] := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_134() runs on GeneralComp { + var A v_val := { 1, 2 }; + f_test(v_val[0], v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_134()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_135.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_135.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f69bac737c6a1f123aa393a40d733169fedcc633 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_135.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing anytype value and its element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_135 { + + type component GeneralComp { + } + + function f_test (inout integer p_val, inout anytype p_any) { + p_any.integer := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_135() runs on GeneralComp { + var anytype v_val := { integer := 1 }; + f_test(v_val.integer, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_135()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_136.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_136.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32d9417b29ef782d8d6fd5b9b72d69473e57030b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_136.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing record and its sub-elements to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_136 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type record R { + Sub field1 + } + + function f_test (inout integer p_val, inout R p_rec) { + p_rec.field1.subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_136() runs on GeneralComp { + var R v_val := { field1 := { subfield1 := 1 } }; + f_test(v_val.field1.subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_136()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_137.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_137.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76158721afdb70a219f31b54c86863eaacce3ff8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_137.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing set and its sub-field to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_137 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type set S { + Sub field1 + } + + function f_test (inout integer p_val, inout S p_set) { + p_set.field1.subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_137() runs on GeneralComp { + var S v_val := { field1 := { subfield1 := 1 } }; + f_test(v_val.field1.subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_137()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_138.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_138.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49314a063f9615bd9765f227bdf9543bd7163b00 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_138.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing union and its sub-element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_138 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type union U { + Sub option1, + charstring option2 + } + + function f_test (inout integer p_val, inout U p_un) { + p_un.option1.subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_138() runs on GeneralComp { + var U v_val := { option1 := { subfield1 := 1 } }; + f_test(v_val.option1.subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_138()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_139.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_139.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e0f9e0f1a5f526304fa402669d2702f5c9dc679 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_139.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing record of and its sub-element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_139 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type record of Sub RS; + + function f_test (inout integer p_val, inout RS p_rec) { + p_rec[0].subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_139() runs on GeneralComp { + var RS v_val := { { subfield1 := 1 } }; + f_test(v_val[0].subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_139()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_140.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_140.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f27a9a8bc205f8c683ecde1551c9acb674e052fa --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_140.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing set of and its sub-element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_140 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type set of Sub SoS; + + function f_test (inout integer p_val, inout SoS p_set) { + p_set[0].subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_140() runs on GeneralComp { + var SoS v_val := { { subfield1 := 1 } }; + f_test(v_val[0].subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_140()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_141.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_141.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..886a0c52be0f63b1ef60503c1780a67f91f97db4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_141.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing array and its sub-element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_141 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + type Sub A[2]; + + function f_test (inout integer p_val, inout A p_arr) { + p_arr[0].subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_141() runs on GeneralComp { + var A v_val := { { subfield1 := 1 }, { subfield1 := 2 } }; + f_test(v_val[0].subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_141()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_142.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_142.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf8be24358a21b6ed040b268b3587eff63bd134e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_142.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing anytype value and its sub-element to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_142 { + + type component GeneralComp { + } + + type record Sub { + integer subfield1 + } + + function f_test (inout integer p_val, inout anytype p_any) { + p_any.Sub.subfield1 := 10; + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_142() runs on GeneralComp { + var anytype v_val := { Sub := { subfield1 := 1 } }; + f_test(v_val.Sub.subfield1, v_val); + } + + control { + execute(TC_NegSem_050402_actual_parameters_142()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_143.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_143.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eab31189d10cc40e6db7e9a03375513678015239 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_143.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing distinct union alternatives to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_143 { + + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + function f_test (inout integer p_val, inout charstring p_char) { + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_143() runs on GeneralComp { + var U v_val := { option1 := 1 }; + f_test(v_val.option1, v_val.option2); + } + + control { + execute(TC_NegSem_050402_actual_parameters_143()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_144.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_144.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..149e7aa7bdf43a89c013d5e862d957efeee24589 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_144.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that error is generated when passing distinct union alternatives to inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Whenever a value or template of a record, set, union, record of, set of, array +// and anytype type is passed as an actual parameter to an inout parameter, none of +// the fields or elemens of this structured value or template shall be passed as +// an actual parameter to another inout parameter of the same parameterized TTCN-3 +// object. This restriction applies recursively to all sub-elements of the structured +// value or template in any level of nesting. + +module NegSem_050402_actual_parameters_144 { + + type component GeneralComp { + } + + function f_test (inout integer p_val, inout charstring p_char) { + setverdict(pass); + } + + testcase TC_NegSem_050402_actual_parameters_144() runs on GeneralComp { + var anytype v_val := { integer := 1 }; + f_test(v_val.integer, v_val.charstring); + } + + control { + execute(TC_NegSem_050402_actual_parameters_144()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_145.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_145.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75682241bed548c687e622da2becae53940e86e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_145.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the fourth part of the Example 3 produces the expected error + ** @verdict pass reject + ***************************************************/ + +module NegSem_050402_actual_parameters_145 { + + type component GeneralComp { + } + type record of integer RoI; + + function f_testReferences (inout RoI p_roi, inout integer p_elem) { + } + + testcase TC_NegSem_050402_actual_parameters_145() runs on GeneralComp { + var RoI v_roi := { 0, 1, 2, 3, 4, 5 }; + f_testReferences(v_roi, v_roi[2]); // produces an error as elements of v_roi are not allowed + // to be passed by reference if the parent structure (v_roi) is passed by reference too. + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_145()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_146.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_146.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06837f960d54eee540b66a8231744b4921a47990 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_146.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literal cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_146 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_146() runs on GeneralComp { + f_test(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_146()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_147.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_147.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed16121327e52e367f8270ccd3199aab454c179d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_147.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expression cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_147 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_147() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_147()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_148.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_148.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f70773c79f865d77977878dff259d466057692b0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_148.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_148 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_148() runs on GeneralComp { + f_test(f_ret()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_148()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_149.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_149.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfcecc899bd4e36ebfecb75c4a38f70228cbee91 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_149.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_149 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_149() runs on GeneralComp { + f_test(PX_VAL); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_149()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_150.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_150.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d183cdc6fcbccd1a09aab4871356b263ccd82f1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_150.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that templates cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_150 { + + type component GeneralComp { + } + + template integer mw_msg := ?; + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_150() runs on GeneralComp { + f_test(mw_msg); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_150()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_151.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_151.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6d5235d800d2c7265b99da925ca69fd0a7b175d7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_151.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as actual out value parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_151 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_151() runs on GeneralComp { + const integer c_val := 3; + f_test(c_val); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_151()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_152.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_152.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6dc6c0e0a75651a3b2f6ea388b6596c70c59ce3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_152.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literal cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_152 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_NegSem_050402_actual_parameters_152() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(1); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_152()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_153.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_153.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0de3fe5820917c87cf0cd8d7d2a3a591638b2f30 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_153.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expression cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_147 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_153() runs on GeneralComp { + var integer v_val := 5; + timer t_tmr := 0.1; + t_tmr.start; + a_test(10 + f_ret() - v_val); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_153()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_154.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_154.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b5984ae03c441b6eab1453e93e43dcc843f7eb7c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_154.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_154 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_NegSem_050402_actual_parameters_154() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(f_ret()); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_154()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_155.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_155.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..904e28b1af01861c98b3ac71212553cc661fd83f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_155.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_155 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_NegSem_050402_actual_parameters_155() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(PX_VAL); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_155()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_156.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_156.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f686d4a80f0d712e481676ea5531e9a1257b9b4a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_156.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that templates cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_156 { + + type component GeneralComp { + } + + template integer mw_msg := ?; + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_NegSem_050402_actual_parameters_156() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(mw_msg); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_156()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_157.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_157.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da5ed8d07cbc12f989c2b04f33c55cdd62e501d4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_157.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants cannot be used as actual out value parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module NegSem_050402_actual_parameters_157 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_NegSem_050402_actual_parameters_157() runs on GeneralComp { + const integer c_val := 3; + timer t_tmr := 0.1; + t_tmr.start; + a_test(c_val); + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_157()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_158.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_158.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebb2bd1f7f4018c42c6c8fcadf8da50255af6dbb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_158.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function cannot have more actual than formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The number of actual parameters in the list notation shall not exceed the number of parameters +// in the formal parameter list. + +module NegSem_050402_actual_parameters_158 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_158() runs on GeneralComp { + f_test(1, 2); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_158()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_159.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_159.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..863816ba3fff91cebcc8172063be352304525bee --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_159.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that templates cannot have more actual than formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The number of actual parameters in the list notation shall not exceed the number of parameters +// in the formal parameter list. + +module NegSem_050402_actual_parameters_159 { + + type component GeneralComp { + } + + template integer mw_range (integer p_par) := (0..p_par); + + testcase TC_NegSem_050402_actual_parameters_159() runs on GeneralComp { + log(mw_range(1, 2)); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_159()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_160.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_160.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be3d59b0466e7ce4f776f4858d0adda4bb8fefef --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_160.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that altstep cannot have more actual than formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The number of actual parameters in the list notation shall not exceed the number of parameters +// in the formal parameter list. + +module NegSem_050402_actual_parameters_160 { + + type component GeneralComp { + } + + altstep a_test(in integer p_val) { + [] any timer.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_NegSem_050402_actual_parameters_160() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(1, 2); // tested parameter passing + } + + control { + execute(TC_NegSem_050402_actual_parameters_160()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_161.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_161.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48a9887df142c7257da023655c399aec98cdfd68 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_161.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function cannot have more actual than formal parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The number of actual parameters in the list notation shall not exceed the number of parameters +// in the formal parameter list. + +module NegSem_050402_actual_parameters_161 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_161(in integer p_val) runs on GeneralComp { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_161(1, 2)); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_162.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_162.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed1a617783c2285d9a4f535e738d25de709e362b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_162.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that restricted template variables cannot be passed to unrestricted inout template parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For inout formal template parameters, the template restriction of the actual and the formal parameter must be the same. + +module NegSem_050402_actual_parameters_162 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + function f_test (inout template R1 p_val) { + if (valueof(p_val) == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_162() runs on GeneralComp { + var template(value) R1 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_162()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_163.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_163.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb2cbec722a18aec09202b8f25e07d0f9905b230 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_163.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that unrestricted template variables cannot be passed to restricted inout template parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For inout formal template parameters, the template restriction of the actual and the formal parameter must be the same. + +module NegSem_050402_actual_parameters_163 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + function f_test (inout template(value) R1 p_val) { + if (valueof(p_val) == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_163() runs on GeneralComp { + var template R1 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_163()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_164.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_164.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1c68670a6f9e924418c53ed435c1ae6267435c1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_164.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that restricted template variables cannot be passed to inout template parameters with a different restriction + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For inout formal template parameters, the template restriction of the actual and the formal parameter must be the same. + +module NegSem_050402_actual_parameters_164 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + function f_test (inout template(omit) R1 p_val) { + if (valueof(p_val) == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_164() runs on GeneralComp { + var template(value) R1 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_NegSem_050402_actual_parameters_164()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_165.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_165.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0cdbf2b0996347a2889814325ac9ac3fd4b1fa99 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_165.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value variables cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_165 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 2; + } + + testcase TC_NegSem_050402_actual_parameters_165() runs on GeneralComp { + var integer vm_msg; + f_test(vm_msg); // tested parameter passing + if (match(2, vm_msg)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_165()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_166.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_166.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7eb2be9fb3fabd296a5206ee7d231ec6d4a6fba4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_166.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value in parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_166 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + function f_caller(in integer p_val) { + f_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_166() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_166()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_167.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_167.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5946f3666103224bc08b2d000e04feaea150d596 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_167.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value out parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_167 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + function f_caller(out 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 + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_167() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_167()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_168.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_168.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40e8f56fc5387f835978fa8c08b4811020f3b80f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_168.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value inout parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_168 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + function f_caller(inout integer p_val) { + f_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_168() runs on GeneralComp { + var 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_168()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_169.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_169.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..472e386e87a5617b463f2f28af363f62adcba0eb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_169.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value variable element reference cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_169 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(out template integer p_val) { + p_val := ?; + } + + testcase TC_NegSem_050402_actual_parameters_169() runs on GeneralComp { + var R v_val := { field1 := 10 }; + f_test(v_val.field1); // tested parameter passing + if (match( { field1 := 0 }, v_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_169()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_170.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_170.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69270ded6d19ea37ebaa9df23443b48bf8310a6a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_170.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as out formal template parameters of functions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_170 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(out template integer p_val) { + p_val := ?; + } + + function f_caller(in R p_param) { + f_test(p_param.field1); // tested parameter passing + if (match( { field1 := 0 }, p_param)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_170() runs on GeneralComp { + f_caller({field1 := 11 }); + } + + control { + execute(TC_NegSem_050402_actual_parameters_170()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_171.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_171.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..791ff1056fe168bc750ae92735037ec6bd3dd475 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_171.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value variables cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_171 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + testcase TC_NegSem_050402_actual_parameters_171() runs on GeneralComp { + var integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + if (match(0, vm_msg)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_171()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_172.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_172.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4cc26a41ec9e6ccb4c3207b0dc1e6bd7e8731367 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_172.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value in parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_172 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(in integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_172() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_172()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_173.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_173.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab52fc018b53b41d3e7ede92fd895239a54081e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_173.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value out parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_173 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(out integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + if (match(0 , p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_173() runs on GeneralComp { + var integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_173()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_174.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_174.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10244d1c03b320ea15e41458ea9c54ada06aec44 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_174.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value inout parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_174 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(inout integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_NegSem_050402_actual_parameters_174() runs on GeneralComp { + var integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_NegSem_050402_actual_parameters_174()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_175.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_175.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51fb44d706471aa9258d281ba240a44b2b86de2f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_175.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value variable element reference cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_175 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 5; + } + } + + testcase TC_NegSem_050402_actual_parameters_175() runs on GeneralComp { + var R v_val := { field1 := 10 }; + t.start; + a_test(v_val.field1); // tested parameter passing + if (match({ field1 := 5 }, v_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_050402_actual_parameters_175()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_176.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_176.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35889b5df028611c001a1a07a348454bc045e473 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_176.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as out formal template parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_176 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 5; + } + } + + function f_caller(in R p_param) runs on GeneralComp { + a_test(p_param.field1); // tested parameter passing + if (match({ field1 := 5 }, p_param)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_NegSem_050402_actual_parameters_176() runs on GeneralComp { + t.start; + f_caller({field1 := 11 }); + } + + control { + execute(TC_NegSem_050402_actual_parameters_176()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_177.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_177.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2da4d1ce2132f7f56bfd070bbf94db81c7c85096 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_177.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value variables cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_177 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_177(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + var integer vm_msg := 2; + execute(TC_NegSem_050402_actual_parameters_177(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_178.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_178.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e68b33d513e52a86e9716c9a8b30b460237b18d6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_178.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value in parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_178 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_178(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(in integer p_val) { + execute(TC_NegSem_050402_actual_parameters_178(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_179.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_179.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18031c01bfe25ec7c139be8e16230da4affd650c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_179.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value out parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_179 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_179(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(out integer p_val) { + execute(TC_NegSem_050402_actual_parameters_179(p_val)); // tested parameter passing + } + + control { + var integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_180.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_180.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..29fa2fb9c0939cfd406a394dbcadf4310253e868 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_180.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that value inout parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_180 { + + type component GeneralComp { + } + + testcase TC_NegSem_050402_actual_parameters_180(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(inout integer p_val) { + execute(TC_NegSem_050402_actual_parameters_180(p_val)); // tested parameter passing + } + + control { + var integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_181.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_181.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f66eed8f693a481e9e617dcf34b6ed79021dfd48 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_181.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variable element reference cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_181 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_NegSem_050402_actual_parameters_181(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + var R v_val := { field1 := 10 }; + execute(TC_NegSem_050402_actual_parameters_181(v_val.field1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_182.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_182.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6e7465a637894b6f1a112452bf137208fdaeeb2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_182.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters cannot be used as out formal template parameters of test cases + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module NegSem_050402_actual_parameters_182 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_NegSem_050402_actual_parameters_182(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(in R p_param) { + execute(TC_NegSem_050402_actual_parameters_182(p_param.field1)); // tested parameter passing + } + + control { + var R mw_t := { field1 := 1 }; + f_caller(mw_t); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_183.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_183.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1482178f66ad74207cd95b9c4cfb45d65c07de32 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_183.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that parameter reuse is not allowed in the mixed notation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction o +// If the mixed notation is used, ... the parameters given in assignment notation shall not assign parameters +// that already have an actual parameter given in list notation. + +module NegSem_050402_actual_parameters_183 { + + type component GeneralComp { + } + + function f_mixed (out integer p_par1, in integer p_par2 := 2, inout integer p_par3) { + p_par1 := 1 + p_par2; + if (p_par2 == 2 and p_par3 == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_NegSem_050402_actual_parameters_183() runs on GeneralComp { + var integer v := 0; + f_mixed(-, 5, p_par3 := v, p_par2 := 2); + + setverdict(pass); + } + + control { + execute(TC_NegSem_050402_actual_parameters_183()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSyn_050402_actual_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSyn_050402_actual_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64cefafbe254971ddcc2ecb46d78a526290950fc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSyn_050402_actual_parameters_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in mixed notation, no value list notation can be used following the first assignment notation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction o +// If the mixed notation is used, no value list notation shall be used following the first assignment notation + +module NegSyn_050402_actual_parameters_001 { + + type component GeneralComp { + } + + function f_mixed (out integer p_par1, in integer p_par2 := 2, inout integer p_par3) { + p_par1 := 1 + p_par2; + if (p_par2 == 2 and p_par3 == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_NegSyn_050402_actual_parameters_001() runs on GeneralComp { + var integer v := 0; + f_mixed(-,p_par2 := 2, v); + + setverdict(pass); + } + + control { + execute(TC_NegSyn_050402_actual_parameters_001()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f89eee94b5a60626c57d1f950b618d4e75d85e39 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.2, Ensure that the IUT accepts allowed assignments of actual parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_050402_actual_parameters_001 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + + +type component GeneralComp { + +} + +testcase TC_Sem_050402_actual_parameters_001 ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + var template MyRecord ReceivedRecord := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + if ( match(ExpectedMatch, ReceivedRecord)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + var MyRecord ModifiedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + var MyRecord PartlyModifiedValues := { + field1 := 0, + field2 := false, + field3 := null, + field4 := e_white, + field5 := 1 + } + +//possible ways of invoking assignment of actual parameters + execute(TC_Sem_050402_actual_parameters_001(DefaultValues)); + execute(TC_Sem_050402_actual_parameters_001(DefaultValues,-,-,-,-,-)); + execute(TC_Sem_050402_actual_parameters_001(ExpectedMatch:=DefaultValues)); + + execute(TC_Sem_050402_actual_parameters_001(ModifiedValues,1,false,1,e_white,1)); + execute(TC_Sem_050402_actual_parameters_001(p_integerTemplate:=1,p_boolean:=false,p_enumerated:=e_white,p_integer:=1,p_address:=1,ExpectedMatch:=ModifiedValues)); + + execute(TC_Sem_050402_actual_parameters_001(PartlyModifiedValues,-,false,-,e_white,-)); + execute(TC_Sem_050402_actual_parameters_001(p_boolean:=false,p_enumerated:=e_white,ExpectedMatch:=PartlyModifiedValues)); + +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1745d70b1fce955ad097dce6021f700c47359d2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_002.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4.2, Ensure that the IUT accepts nested assignment of actual parameters. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_002 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + +template MyRecord m_parametrizedTemplate1 + ( + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) := { + field1 := p_integer, + field2 := p_boolean, + field3 := p_address, + field4 := p_enumerated, + field5 := p_integerTemplate +} + + +template MyRecord m_parametrizedTemplate2 + ( + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) := { + field1 := p_integer+1, //this line is different from the previous template + field2 := not p_boolean, //this line is different from the previous template + field3 := p_address, + field4 := p_enumerated, + field5 := p_integerTemplate +} + + + +type component GeneralComp { + +} + + +testcase TC_Sem_050402_actual_parameters_002(template MyRecord p_templateSelection) runs on GeneralComp { + + + var MyRecord ExpectedValues := { + field1 := 1, + field2 := false, + field3 := 1, + field4 := e_white, + field5 := 1 + } + + if (match(ExpectedValues, p_templateSelection)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + execute(TC_Sem_050402_actual_parameters_002(m_parametrizedTemplate1(1,false,1,e_white,1)) ); + execute(TC_Sem_050402_actual_parameters_002(m_parametrizedTemplate2(0,true,1,e_white,1)) ); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62f0dff06ae1dbe778a8c78f88d5d1c187208557 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_003.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_003 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_003() runs on GeneralComp { + f_test(1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_003()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26823f55c0bebc87f1560967722b282b49e7d057 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_004 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(in integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_004() runs on GeneralComp { + f_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44a59d714117ee409d8f6b217b7cc216e224a445 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_005.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_005 { + + type component GeneralComp { + } + + const integer c_val := 3; + + function f_test(in integer p_val) { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_005() runs on GeneralComp { + f_test(c_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_005()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddbdbc6245de6b221638ffc824931b587fd689dc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_006.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_006 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_006() runs on GeneralComp { + var integer v_val := 4; + f_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_006()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..760ec813a18292d140a387f5f42c671d9e25b0e2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_007.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_007 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + function f_test(in integer p_val) { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_007() runs on GeneralComp { + f_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_007()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee0e8341e4c30c28d5f73017cf9afdc42e488757 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_008.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_008 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_008() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_008()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd7e3b206f7bda5f5ac12c2700644d24fe3bead0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_009.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_009 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_009() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_009()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f998c62c2cb77786a305fc01c0011e633c716a5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_010.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_010 { + + type component GeneralComp { + } + + function f_test(in integer p_val) { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + f_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_010() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_010()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc71ca7bfadaef130257cf21f4db6c8ea5c92851 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_011.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_011 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(in integer p_val) { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_011() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_011()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_012.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48e2477f234284e3b1ffa88288b995da2c4d6067 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_012.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_012 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_012() runs on GeneralComp { + if (match(12, m_test(1))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_012()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_013.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f552224033e33e6b0ef340707ded5e3a27eadb6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_013.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_013 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_013() runs on GeneralComp { + if (match(13, m_test(PX_VAL))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_013()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_014.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..945200e94bdebabf486fd632fed5e5b8600f889c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_014.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_014 { + + type component GeneralComp { + } + + const integer c_val := 3; + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_014() runs on GeneralComp { + if (match(14, m_test(c_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_014()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_015.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32e6145769348c1500aef42f3d55d85a49e21aac --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_015.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_015 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_015() runs on GeneralComp { + var integer v_val := 4; + if (match(15, m_test(v_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_015()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_016.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebc41205d2dc932ea4078110979c08f32c2a7591 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_016.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_016 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_016() runs on GeneralComp { + if (match(16, m_test(f_ret()))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_016()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_017.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..707db428db71751df206859d12c34dad7838b90d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_017.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_017 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 11 + p_val; + + function f_caller(in integer p_val) { + if (match(17, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_017() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_017()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_018.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e40b11284041b6ca2f3e0ece1546c04f5ba0ae78 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_018.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_018 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 11 + p_val; + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + if (match(18, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_018() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_018()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_019.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..357f62913b5d6d430734c90d5a97b973bd5985a2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_019.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_019 { + + type component GeneralComp { + } + + template integer m_test(in integer p_val) := 11 + p_val; + + function f_caller(inout integer p_val) { + if (match(19, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_019() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_019()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_020.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b85f848d3373b5191f2403ca97dcfabb0424c274 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_020.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal value parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_020 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + template integer m_test(in integer p_val) := 11 + p_val; + + testcase TC_Sem_050402_actual_parameters_020() runs on GeneralComp { + var integer v_val := 5; + if (match(20, m_test(10 + f_ret() - v_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_020()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_021.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd949c53ccaf60a73682439a29346456d4d77625 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_021.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_021 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_021() runs on GeneralComp { + t.start; + a_test(1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_021()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_022.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9baff4ce55f50c13f360bcf3095c9acff45323f7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_022.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_022 { + + type component GeneralComp { + timer t := 0.0; + } + + modulepar integer PX_VAL := 2; + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_022() runs on GeneralComp { + t.start; + a_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_022()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_023.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..587f1381ec7b19f19c34f3ea2c940a7655f8deb0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_023.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_023 { + + type component GeneralComp { + timer t := 0.0; + } + + const integer c_val := 3; + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_023() runs on GeneralComp { + t.start; + a_test(c_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_023()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_024.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..328af75cb3b6d3328996e44645ffea0887089ad5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_024.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_024 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_024() runs on GeneralComp { + var integer v_val := 4; + t.start; + a_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_024()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_025.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d093492da9f6ebf356ee20f8d4fc547b9a85549 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_025.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_025 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 5; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_025() runs on GeneralComp { + t.start; + a_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_025()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_026.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7813ad881da6cb55f132ccb95ada89a61e7fa4cb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_026.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_026 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in integer p_val) runs on GeneralComp{ + t.start; + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_026() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_026()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_027.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d46c82f107c3168dc997147c94d791b23c6e430 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_027.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_027 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out integer p_val) runs on GeneralComp { + t.start; + p_val := 7; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_027() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_027()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_028.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07090e3e2e5e1ee17d9bc2794984e1631d61d080 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_028.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_028 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout integer p_val) runs on GeneralComp { + t.start; + a_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_028() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_028()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_029.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..651b9dcfa939c717888ce1888950f65801ea2c85 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_029.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_029 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 4; + } + + altstep a_test(integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_029() runs on GeneralComp { + var integer v_val := 5; + t.start; + a_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_029()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_030.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eccceb2a8f18e8f794e859ed18701af22c38e940 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_030.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_030 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_030(in integer p_val) runs on GeneralComp { + if (p_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_030(1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_031.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a3019ef6c4ca59d47e8a1214fae30b15aa6df9c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_031.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_031 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + testcase TC_Sem_050402_actual_parameters_031(in integer p_val) runs on GeneralComp { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_031(PX_VAL)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_032.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dd594db545de65b58dd46906e675ba53a192069 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_032.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_032 { + + type component GeneralComp { + } + + const integer c_val := 3; + + testcase TC_Sem_050402_actual_parameters_032(in integer p_val) runs on GeneralComp { + if (p_val == 3) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_032(c_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_033.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b189d109042259f49fe00da5c7ca290994e2460 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_033.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_033 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_033(in integer p_val) runs on GeneralComp { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 4; + execute(TC_Sem_050402_actual_parameters_033(v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_034.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..723f931f00768f96e04d81bf58bfac3d3ad6a868 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_034.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_034 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + testcase TC_Sem_050402_actual_parameters_034(in integer p_val) runs on GeneralComp { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_034(f_ret())); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_035.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebe4cb1359b3c63d15d2947b516d6124a7016dbb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_035.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_035 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_035(in integer p_val) runs on GeneralComp { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + execute(TC_Sem_050402_actual_parameters_035(p_val)); // tested parameter passing + } + + control { + f_caller(6); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_036.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a0b255251b5c3d6d710b0c9ca533f9cf70beadd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_036.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_036 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_036(in integer p_val) runs on GeneralComp { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + execute(TC_Sem_050402_actual_parameters_036(p_val)); // tested parameter passing + } + + + control { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_037.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a8ca84dc7eee7f9a11a8a2b8a8bdf78006ba339 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_037.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_037 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_037(in integer p_val) runs on GeneralComp { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + execute(TC_Sem_050402_actual_parameters_037(p_val)); // tested parameter passing + } + + control { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_038.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8c3c2fc1fad1e86cb67cb00635088f40f0bf794 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_038.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// 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 Sem_050402_actual_parameters_038 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + testcase TC_Sem_050402_actual_parameters_038(in integer p_val) runs on GeneralComp { + if (p_val == 9) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 5; + execute(TC_Sem_050402_actual_parameters_038(10 + f_ret() - v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_039.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71ebbe77f0c8106de1065a88c799f5100e5cfaec --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_039.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_039 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_039() runs on GeneralComp { + var integer v_val := 4; + f_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_039()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_040.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12060d169158e392251edecf06ea72db6074e3c1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_040.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_040 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_040() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_040()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_041.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dafad8afab5f07800dcb9c9ce6a1036291741f04 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_041.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_041 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_041() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_041()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_042.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3518f2845232c6dbd2c35fc6f75cb7dfe05d58c8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_042.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_042 { + + type component GeneralComp { + } + + function f_test(inout integer p_val) { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + f_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_042() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_042()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_043.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4700cfea285996e7fed9ba64429ed18045fafc10 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_043.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variable element reference can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_043 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout integer p_val) { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_043() runs on GeneralComp { + var R v_val := { field1 := 10 }; + f_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_043()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_044.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02fc78c6de19162d8a85320e5c297d2f82a695f0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_044.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_044 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout integer p_val) { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in R p_param) { + f_test(p_param.field1); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_044() runs on GeneralComp { + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_044()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_045.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f673880c24656170aa7325b6e85443e8f29522b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_045.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_045 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_045() runs on GeneralComp { + var integer v_val := 4; + t.start; + a_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_045()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_046.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba6cc0ffdc293e35df62518c3562c834c99a05eb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_046.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_046 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in integer p_val) runs on GeneralComp{ + t.start; + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_046() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_046()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_047.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b1db9680fbc24f16d5b70fb1251bf1f87c09902 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_047.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_047 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out integer p_val) runs on GeneralComp { + t.start; + p_val := 7; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_047() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_047()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_048.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00cc303a0692f32870d2dc04e945088d0724dcc3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_048.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_048 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout integer p_val) runs on GeneralComp { + t.start; + a_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_048() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_048()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_049.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74ca0b9a9463d96baf20acbc2f76438cd7a09eaf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_049.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variable element reference can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_049 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_049() runs on GeneralComp { + var R v_val := { field1 := 10 }; + t.start; + a_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_049()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_050.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41197ff834c7851f00deca459b30bb6eecc64468 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_050.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_050 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout integer p_val) runs on GeneralComp { + []t.timeout { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in R p_param) runs on GeneralComp { + a_test(p_param.field1); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_050() runs on GeneralComp { + t.start; + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_050()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_051.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f7327818bb24a14c4fae4c7a9648a92a5671d46 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_051.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_051 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_051(inout integer p_val) runs on GeneralComp { + if (p_val == 4) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 4; + execute(TC_Sem_050402_actual_parameters_051(v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_052.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b02737059d7eded72eb8dfeb175342fc4ca3093 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_052.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_052 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_052(inout integer p_val) runs on GeneralComp { + if (p_val == 6) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + execute(TC_Sem_050402_actual_parameters_052(p_val)); // tested parameter passing + } + + control { + f_caller(6); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_053.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1cf0fe8d4fab5b9cc9fe47accaeb19b55b0bcdb9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_053.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_053 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_053(inout integer p_val) runs on GeneralComp { + if (p_val == 7) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + execute(TC_Sem_050402_actual_parameters_053(p_val)); // tested parameter passing + } + + + control { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_054.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..071ba8381c2676f74c5afb715a09654cdd87bb50 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_054.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_054 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_054(inout integer p_val) runs on GeneralComp { + if (p_val == 8) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + execute(TC_Sem_050402_actual_parameters_054(p_val)); // tested parameter passing + } + + control { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_055.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b39b00e4141b9f022c4d9be289f15dd86c6dd2cf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_055.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variable element reference can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_055 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_055(inout integer p_val) runs on GeneralComp { + if (p_val == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var R v_val := { field1 := 10 }; + execute(TC_Sem_050402_actual_parameters_055(v_val.field1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_056.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e8896afd2f192954e58d380da87a152f7666e59 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_056.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal value parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal value parameters shall be variables +// or formal value parameters (of in, inout or out parameterization) or references to +// elements of variables or formal value parameters of structured types. + +module Sem_050402_actual_parameters_056 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_056(inout integer p_val) runs on GeneralComp { + if (p_val == 11) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in R p_param) { + execute(TC_Sem_050402_actual_parameters_056(p_param.field1)); // tested parameter passing + } + + control { + f_caller({field1 := 11 }); + + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_057.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9004d26f293781cd3c4cb3850f473b800e30c8db --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_057.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_057 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_057() runs on GeneralComp { + f_test(1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_057()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_058.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f993bbbf1a441f3a8972803dd4278962d009cc3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_058.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_058 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + function f_test(in template integer p_val) { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_058() runs on GeneralComp { + f_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_058()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_059.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc718cb027febeefdec422b0116b20a3a4858ab6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_059.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_059 { + + type component GeneralComp { + } + + const integer c_val := 3; + + function f_test(in template integer p_val) { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_059() runs on GeneralComp { + f_test(c_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_059()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_060.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9399201057bea11fdf4fe78fd0e8be90625ca6c1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_060.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_060 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(4, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_060() runs on GeneralComp { + var integer v_val := 4; + f_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_060()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_061.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee11958d0cb03a2eb42cfc6d762da6b485e404e0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_061.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_061 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + function f_test(in template integer p_val) { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_061() runs on GeneralComp { + f_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_061()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_062.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc174bbe1c41b286d6585fee66bc4f66c0cc5d57 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_062.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_062 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(6, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_062() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_062()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_063.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4652a33595e39956dc416d32e4f6280d7a2b1a6e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_063.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_063 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(7, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_063() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_063()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_064.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9164851c907691425d138f57d25ffa6d1a5afe9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_064.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_064 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(8, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + f_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_064() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_064()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_065.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec410123afab228f908b14d1ca71a0468957487c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_065.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_065 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + function f_test(in template integer p_val) { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_065() runs on GeneralComp { + var integer v_val := 5; + f_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_065()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_066.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b17d09c5fdab78d3f31fa5d5ca5ed3a87cd99eb8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_066.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_066 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + function f_test(in template integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_066() runs on GeneralComp { + f_test(m_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_066()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_067.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1a3f0150b2647041437244bf363bb294be54e3e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_067.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_067 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_067() runs on GeneralComp { + var template integer vm_msg := 2; + f_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_067()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_068.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dbd4b64224b44831bf756bf8cf58a40d628287d1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_068.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_068 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_068() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_068()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_069.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c578b727f8ac73bcfa4a161f5e8d60c4db633343 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_069.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_069 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(4, p_val)) { 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_Sem_050402_actual_parameters_069() 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_Sem_050402_actual_parameters_069()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_070.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4eb472e4aae75aa22ca7e82c57d1b08138e7e1f0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_070.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as in formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_070 { + + type component GeneralComp { + } + + function f_test(in template integer p_val) { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_070() 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_Sem_050402_actual_parameters_070()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_071.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2742903352b6474fcbc26664a1ef156687323cba --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_071.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_071 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_071() runs on GeneralComp { + if (match(12, m_test(1))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_071()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_072.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cf3b1de8c3f61cb98dacfe7ad95133cecfbd276 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_072.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_072 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_072() runs on GeneralComp { + if (match(13, m_test(PX_VAL))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_072()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_073.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9e274a3263269011f2ac61ec22c8aedf642d25e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_073.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_073 { + + type component GeneralComp { + } + + const integer c_val := 3; + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_073() runs on GeneralComp { + if (match(14, m_test(c_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_073()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_074.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71654dba428e5165dddb6299bae8ffcd076d4233 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_074.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_074 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_074() runs on GeneralComp { + var integer v_val := 4; + if (match(15, m_test(v_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_074()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_075.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..324663faf835445320ba6c92f1db91f748546c0a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_075.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_075 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_075() runs on GeneralComp { + if (match(16, m_test(f_ret()))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_075()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_076.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..100a0ebf2b8a3bb21819401b16f888ee727fb6a8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_076.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_076 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + function f_caller(in integer p_val) { + if (match(17, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_076() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_076()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_077.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bd65673113e1ae02177d5f97ca7eb0a81443014 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_077.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_077 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + if (match(18, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_077() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_077()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_078.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c164da7a4ebd999183a988b7da6ae9fea33954a5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_078.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_078 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + function f_caller(inout integer p_val) { + if (match(19, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_078() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_078()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_079.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be035b2b0d0c8388d40aa918d9fd535e77e25164 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_079.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_079 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + template integer m_test(in template integer p_val) := 11 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_079() runs on GeneralComp { + var integer v_val := 5; + if (match(20, m_test(10 + f_ret() - v_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_079()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_080.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c5cd1f0f1d490a551e669edd9f964cac0f3ad8f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_080.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_080 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + template integer m_test(in template integer p_val) := 5 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_080() runs on GeneralComp { + if (match(6, m_test(m_msg))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_080()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_081.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8971e99b159f1c94e1061127061a68a2284dac7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_081.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_081 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 5 + valueof(p_val); + + testcase TC_Sem_050402_actual_parameters_081() runs on GeneralComp { + var template integer vm_msg := 2; + if (match(7, m_test(vm_msg))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_081()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_082.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fd50fca3d211643af7716b5585e138647763c3b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_082.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_082 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 5 + valueof(p_val); + + function f_caller(in template integer p_val) { + if (match(8, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_082() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_082()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_083.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52522945a7c0be892e5d71df0e092687c1d9380a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_083.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_083 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 5 + valueof(p_val); + + 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 + if (match(9, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_083() 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_Sem_050402_actual_parameters_083()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_084.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..93cc32699a73c0544e2b4820edca918792d1d6de --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_084.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as in formal template parameters of templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_084 { + + type component GeneralComp { + } + + template integer m_test(in template integer p_val) := 5 + valueof(p_val); + + function f_caller(inout template integer p_val) { + if (match(10, m_test(p_val))) { // tested parameter passing + setverdict(pass); + } else { + setverdict(fail); + } + } + + + testcase TC_Sem_050402_actual_parameters_084() 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_Sem_050402_actual_parameters_084()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_085.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fe1ec1999939b9a1bb9e51b2739a3bc2ce66229 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_085.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_085 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_085() runs on GeneralComp { + t.start; + a_test(1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_085()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_086.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..061e5471d70924b977ebbd3f555668fb5a62a030 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_086.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_086 { + + type component GeneralComp { + timer t := 0.0; + } + + modulepar integer PX_VAL := 2; + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_086() runs on GeneralComp { + t.start; + a_test(PX_VAL); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_086()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_087.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfa9f15f48d609d464a46c9a131f9fd057f6a313 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_087.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_087 { + + type component GeneralComp { + timer t := 0.0; + } + + const integer c_val := 3; + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_087() runs on GeneralComp { + t.start; + a_test(c_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_087()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_088.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ea2a665983b05c45356721da33290509712b441 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_088.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_088 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(4, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_088() runs on GeneralComp { + var integer v_val := 4; + t.start; + a_test(v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_088()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_089.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43315b9687142307df40c63175cf2594da0ddbe0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_089.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_089 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 5; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_089() runs on GeneralComp { + t.start; + a_test(f_ret()); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_089()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_090.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f79d73d854c734a9a547af04d33584256e35ca4f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_090.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_090 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(6, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in integer p_val) runs on GeneralComp{ + t.start; + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_090() runs on GeneralComp { + f_caller(6); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_090()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_091.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_091.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aab672cca7d65991ee351535f9414e71f8fdeaa1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_091.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_091 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(7, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out integer p_val) runs on GeneralComp { + t.start; + p_val := 7; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_091() runs on GeneralComp { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_091()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_092.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_092.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db2f60c6b0fd2c59b05114217467cd4c2e0387b4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_092.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_092 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(8, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout integer p_val) runs on GeneralComp { + t.start; + a_test(p_val); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_092() runs on GeneralComp { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_092()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_093.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_093.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5205ef181bff7774464c82ea23b5756179a62e6b --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_093.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_093 { + + type component GeneralComp { + timer t := 0.0; + } + + function f_ret() return integer { + return 4; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_093() runs on GeneralComp { + var integer v_val := 5; + t.start; + a_test(10 + f_ret() - v_val); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_093()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_094.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_094.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1f0c3765308f4c772626724af11aa7d526c6208 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_094.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_094 { + + type component GeneralComp { + timer t := 0.0; + } + + template integer m_msg := 1; + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_094() runs on GeneralComp { + t.start; + a_test(m_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_094()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_095.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_095.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..382f06949323ab0bc876f03c61c313c061da37c4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_095.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_095 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_095() runs on GeneralComp { + var template integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_095()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_096.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_096.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f02fb6a82e8670d62e1d569663c128ee44ffca0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_096.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_096 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_096() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_096()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_097.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_097.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4dd7d88599de06efbbeade132bb66a512c2ebbbe --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_097.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_097 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(4, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out template integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_097() runs on GeneralComp { + var template integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_097()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_098.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_098.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e69e5a9e012b63e6a51748cd12016987b1ad5ee8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_098.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as in formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_098 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(in template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_098() runs on GeneralComp { + var template integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_098()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_099.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_099.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59dbaa02ce3c69a96075e4b5d1265313e7832132 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_099.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that literals can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_099 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_099(in template integer p_val) runs on GeneralComp { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_099(1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_100.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_100.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3eaddc1627ed3df4515aa6a054f9850eebd3e117 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_100.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that module parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_100 { + + type component GeneralComp { + } + + modulepar integer PX_VAL := 2; + + testcase TC_Sem_050402_actual_parameters_100(in template integer p_val) runs on GeneralComp { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_100(PX_VAL)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_101.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_101.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..abeee130cb605635d0a47fe9e6524b4334f03522 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_101.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that constants can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_101 { + + type component GeneralComp { + } + + const integer c_val := 3; + + testcase TC_Sem_050402_actual_parameters_101(in template integer p_val) runs on GeneralComp { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_101(c_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_102.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_102.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3afc920584419ca15021150c04ef8da45800093 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_102.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_102 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_102(in template integer p_val) runs on GeneralComp { + if (match(4, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 4; + execute(TC_Sem_050402_actual_parameters_102(v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_103.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_103.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1fc7937a0a99776686a046522569b56e1a12e3e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_103.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that function calls can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_103 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 5; + } + + testcase TC_Sem_050402_actual_parameters_103(in template integer p_val) runs on GeneralComp { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_103(f_ret())); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_104.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_104.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d683c0392a79101782ab470e982f3eb45ec9e8e1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_104.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_104 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_104(in template integer p_val) runs on GeneralComp { + if (match(6, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in integer p_val) { + execute(TC_Sem_050402_actual_parameters_104(p_val)); // tested parameter passing + } + + control { + f_caller(6); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_105.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_105.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1608c843aeef79fdd8203cdb007d582f85317e1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_105.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_105 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_105(in template integer p_val) runs on GeneralComp { + if (match(7, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(out integer p_val) { + p_val := 7; // out parameter shall have a value before we can pass it to a function + execute(TC_Sem_050402_actual_parameters_105(p_val)); // tested parameter passing + } + + + control { + var integer v_val; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_106.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_106.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2766240e93f02010d840c4bf462f17883c3c9aac --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_106.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_106 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_106(in template integer p_val) runs on GeneralComp { + if (match(8, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout integer p_val) { + execute(TC_Sem_050402_actual_parameters_106(p_val)); // tested parameter passing + } + + control { + var integer v_val := 8; + f_caller(v_val); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_107.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_107.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..176c7e5c9437ac64a4ab4f34e7fdfdacb4297171 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_107.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that expressions can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_107 { + + type component GeneralComp { + } + + function f_ret() return integer { + return 4; + } + + testcase TC_Sem_050402_actual_parameters_107(in template integer p_val) runs on GeneralComp { + if (match(9, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var integer v_val := 5; + execute(TC_Sem_050402_actual_parameters_107(10 + f_ret() - v_val)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_108.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_108.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d0449488c03b40b01c52fdc733512856a138372 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_108.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_108 { + + type component GeneralComp { + } + + template integer m_msg := 1; + + testcase TC_Sem_050402_actual_parameters_108(in template integer p_val) runs on GeneralComp { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_108(m_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_109.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_109.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3be893c1019c3466d24efee81a4056fdfe4f5a11 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_109.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_109 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_109(in template integer p_val) runs on GeneralComp { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template integer vm_msg := 2; + execute(TC_Sem_050402_actual_parameters_109(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_110.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_110.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd8428b7be07036a699d88466cd5551b57153f34 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_110.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_110 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_110(in template integer p_val) runs on GeneralComp { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + execute(TC_Sem_050402_actual_parameters_110(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_111.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_111.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fbbff2c01ab442731ce3f60d0d8a8572c70ef4cb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_111.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_111 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_111(in template integer p_val) runs on GeneralComp { + if (match(4, p_val)) { 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 + execute(TC_Sem_050402_actual_parameters_111(p_val)); // tested parameter passing + } + + control { + var template integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_112.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_112.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34db0c62f6af0cd93f8df8292588096e3ec71fdf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_112.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as in formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to in formal template parameters shall be literal +// values, module parameters, constants, variables, value or template returning (external) +// functions, formal value parameters (of in, inout or out parameterization) of the current +// scope or expressions composed of the above, as well as templates, template variables or +// formal template parameters (of in, inout or out parameterization) of the current scope. + +module Sem_050402_actual_parameters_112 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_112(in template integer p_val) runs on GeneralComp { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + execute(TC_Sem_050402_actual_parameters_112(p_val)); // tested parameter passing + } + + control { + var template integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_113.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_113.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5debcd77d0df1d66eea67c04b9d99d9fc736c10 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_113.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variables can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_113 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 2; + } + + testcase TC_Sem_050402_actual_parameters_113() runs on GeneralComp { + var template integer vm_msg; + f_test(vm_msg); // tested parameter passing + if (match(2, vm_msg)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_113()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_114.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_114.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1b07c6eb10abcbfda19dd23fd636875a4eda57a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_114.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template in parameters can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_114 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + function f_caller(in template integer p_val) { + f_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_114() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_114()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_115.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_115.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8251da099b054c6cc74513f73f03faa5422e638 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_115.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template out parameters can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_115 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + 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 + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_115() 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_Sem_050402_actual_parameters_115()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_116.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_116.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7b6c4522a206e60bf4725308c27f074d9dfd71a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_116.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_116 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := 0; + } + + function f_caller(inout template integer p_val) { + f_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_116() 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_Sem_050402_actual_parameters_116()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_117.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_117.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7fe9ca22fb38b96aa0ca8372148cae0bee1bea08 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_117.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_117 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(out template integer p_val) { + p_val := ?; + } + + testcase TC_Sem_050402_actual_parameters_117() runs on GeneralComp { + var template R v_val := { field1 := 10 }; + f_test(v_val.field1); // tested parameter passing + if (match( { field1 := 0 }, v_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_117()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_118.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_118.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79db2238b60d4a60cd32c194c46898f126ca3929 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_118.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal template parameters can be used as out formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_118 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(out template integer p_val) { + p_val := ?; + } + + function f_caller(in template R p_param) { + f_test(p_param.field1); // tested parameter passing + if (match( { field1 := 0 }, p_param)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_118() runs on GeneralComp { + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_118()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_119.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_119.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa11300808b30765133ebcc4ae8a2451f89484fb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_119.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variables can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_119 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + testcase TC_Sem_050402_actual_parameters_119() runs on GeneralComp { + var template integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + if (match(0, vm_msg)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_119()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_120.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_120.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b0525bb471e3e3dd9c43ba7c8258b59e7ced9a1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_120.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template in parameters can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_120 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(in template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_120() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_120()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_121.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_121.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6c5c38c1e5a213003804a82c98a827169f56c49 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_121.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template out parameters can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_121 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(out template integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + if (match(0 , p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_121() runs on GeneralComp { + var template integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_121()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_122.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_122.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b19de1eb22b17719d329d345bed8f6c377ea8d19 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_122.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_122 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 0; + } + } + + function f_caller(inout template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + if (match(0, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_050402_actual_parameters_122() runs on GeneralComp { + var template integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_122()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_123.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_123.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d643d11182eac9e4c02fbf870c6c82aaab41c0cf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_123.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_123 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 5; + } + } + + testcase TC_Sem_050402_actual_parameters_123() runs on GeneralComp { + var template R v_val := { field1 := 10 }; + t.start; + a_test(v_val.field1); // tested parameter passing + if (match({ field1 := 5 }, v_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_123()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_124.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_124.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9038f5af5e07eceaea92ef1a1d16c036e294a38a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_124.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal template parameters can be used as out formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_124 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(out template integer p_val) runs on GeneralComp { + []t.timeout { + p_val := 5; + } + } + + function f_caller(in template R p_param) runs on GeneralComp { + a_test(p_param.field1); // tested parameter passing + if (match({ field1 := 5 }, p_param)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_124() runs on GeneralComp { + t.start; + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_124()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_125.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_125.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16d50474c0c9ff0e5f7767dabfa83166944d3bfe --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_125.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variables can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_125 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_125(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + var template integer vm_msg := 2; + execute(TC_Sem_050402_actual_parameters_125(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_126.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_126.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae1d3cd8912b71fb35611cd4de52deafd8e08910 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_126.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template in parameters can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_126 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_126(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(in template integer p_val) { + execute(TC_Sem_050402_actual_parameters_126(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_127.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_127.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad353b12affeccfbf6465a824c4354357ef82230 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_127.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template out parameters can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_127 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_127(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(out template integer p_val) { + execute(TC_Sem_050402_actual_parameters_127(p_val)); // tested parameter passing + } + + control { + var template integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_128.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_128.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc0eb1fbd710407c55cfb43c3ddc78bd283d531a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_128.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_128 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_128(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(inout template integer p_val) { + execute(TC_Sem_050402_actual_parameters_128(p_val)); // tested parameter passing + } + + control { + var template integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_129.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_129.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e41653830ce5b3adc67ed2d13163f7c22bcd1b9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_129.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_129 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_129(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + control { + var template R v_val := { field1 := 10 }; + execute(TC_Sem_050402_actual_parameters_129(v_val.field1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_130.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_130.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed914d9554153551c5995f0a8a88fdf344cdc679 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_130.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal template parameters can be used as out formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, +// formal template parameters or references to elements of template variables or formal template +// parameters of structured types. + +module Sem_050402_actual_parameters_130 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_130(out template integer p_val) runs on GeneralComp { + p_val := ?; + setverdict(pass); + } + + function f_caller(in template R p_param) { + execute(TC_Sem_050402_actual_parameters_130(p_param.field1)); // tested parameter passing + } + + control { + var template R mw_t := { field1 := 1 }; + f_caller(mw_t); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_131.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_131.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7eac5229bd0043a554e7fce1263aaac464e507f8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_131.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_131 { + + type component GeneralComp { + } + + function f_test(inout template integer p_val) { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_131() runs on GeneralComp { + var template integer vm_msg := 2; + f_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_131()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_132.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_132.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20656d35978173738923ca42ba23df4ea9b99af0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_132.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_132 { + + type component GeneralComp { + } + + function f_test(inout template integer p_val) { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_132() runs on GeneralComp { + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_132()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_133.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_133.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e506e0f2701f41071ca39b90e4fb4177bc3dfa0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_133.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_133 { + + type component GeneralComp { + } + + function f_test(inout template integer p_val) { + if (match(4, p_val)) { 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_Sem_050402_actual_parameters_133() 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_Sem_050402_actual_parameters_133()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_134.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_134.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db1543f40223ad97c4a741dc7c9cd0fcc88f2a7e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_134.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_134 { + + type component GeneralComp { + } + + function f_test(inout template integer p_val) { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + f_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_134() 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_Sem_050402_actual_parameters_134()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_135.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_135.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1879a5dba801206215d1e3fc49a9114dd34fe5f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_135.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_135 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout template(present) integer p_val) { + if (match(10, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_135() runs on GeneralComp { + var template(present) R v_val := { field1 := 10 }; + f_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_135()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_136.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_136.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4f2ec58906f07b1a4f6afacc7076858c2ea2882 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_136.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal template parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_136 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + function f_test(inout template(present) integer p_val) { + if (match(11, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template(present) R p_param) { + f_test(p_param.field1); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_136() runs on GeneralComp { + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_136()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_137.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_137.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73007ebedc06c8bdd2940293d4cb5321be54c306 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_137.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_137 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_137() runs on GeneralComp { + var template integer vm_msg := 2; + t.start; + a_test(vm_msg); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_137()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_138.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_138.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..552cc8308a4ab36e40e14cdfdeca44eb05af0896 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_138.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_138 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_138() runs on GeneralComp { + t.start; + f_caller(3); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_138()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_139.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_139.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ffdac1132cfa27a1dd2b0f255c1d454eccaeb73 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_139.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_139 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(4, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(out template integer p_val) runs on GeneralComp { + p_val := 4; // out parameter shall have a value before we can pass it to a function + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_139() runs on GeneralComp { + var template integer v_val; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_139()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_140.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_140.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..819858b8c18a706fe2d1a22faa10b2b3a30c36b9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_140.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_140 { + + type component GeneralComp { + timer t := 0.0; + } + + altstep a_test(inout template integer p_val) runs on GeneralComp { + []t.timeout { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(inout template integer p_val) runs on GeneralComp { + a_test(p_val); // tested parameter passing + } + + + testcase TC_Sem_050402_actual_parameters_140() runs on GeneralComp { + var template integer v_val := 5; + t.start; + f_caller(v_val); // this parameter passing is not a subject of the test + } + + control { + execute(TC_Sem_050402_actual_parameters_140()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_141.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_141.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c983bb019c3dc746b77894fdd83e81646d641c67 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_141.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_141 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout template(present) integer p_val) runs on GeneralComp { + []t.timeout { + if (match(10, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_050402_actual_parameters_141() runs on GeneralComp { + var template(present) R v_val := { field1 := 10 }; + t.start; + a_test(v_val.field1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_141()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_142.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_142.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d526d85dbb3a4c0fe82de49ab497838f6f2cb95 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_142.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal template parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_142 { + + type component GeneralComp { + timer t := 0.0; + } + + type record R { + integer field1 + } + + altstep a_test(inout template(present) integer p_val) runs on GeneralComp { + []t.timeout { + if (match(11, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + } + + function f_caller(in template(present) R p_param) runs on GeneralComp { + a_test(p_param.field1); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_142() runs on GeneralComp { + t.start; + f_caller({field1 := 11 }); + } + + control { + execute(TC_Sem_050402_actual_parameters_142()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_143.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_143.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37aeafe53988b1f20a863c995502016b12a6e69e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_143.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template variables can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_143 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_143(inout template integer p_val) runs on GeneralComp { + if (match(2, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template integer vm_msg := 2; + execute(TC_Sem_050402_actual_parameters_143(vm_msg)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_144.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_144.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc576bb9e69cf60d7cef329a2d42a61a4c45a23d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_144.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template in parameters can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_144 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_144(inout template integer p_val) runs on GeneralComp { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template integer p_val) { + execute(TC_Sem_050402_actual_parameters_144(p_val)); // tested parameter passing + } + + control { + f_caller(3); // this parameter passing is not a subject of the test + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_145.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_145.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86691ef8fe296e417afffef58845f591a508912d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_145.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template out parameters can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_145 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_145(inout template integer p_val) runs on GeneralComp { + if (match(4, p_val)) { 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 + execute(TC_Sem_050402_actual_parameters_145(p_val)); // tested parameter passing + } + + control { + var template integer vm_val; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_146.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_146.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9797e75569132fe6894fd4c10c3bc978250ddf0 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_146.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that template inout parameters can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_146 { + + type component GeneralComp { + } + + testcase TC_Sem_050402_actual_parameters_146(inout template integer p_val) runs on GeneralComp { + if (match(5, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(inout template integer p_val) { + execute(TC_Sem_050402_actual_parameters_146(p_val)); // tested parameter passing + } + + control { + var template integer vm_val := 5; + f_caller(vm_val); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_147.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_147.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5439bb0363a755d689f6734004158c9f7207121e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_147.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that template variable element reference can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_147 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_147(inout template(present) integer p_val) runs on GeneralComp { + if (match(10, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + var template(present) R v_val := { field1 := 10 }; + execute(TC_Sem_050402_actual_parameters_147(v_val.field1)); // tested parameter passing + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_148.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_148.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a00df3e9b9b3040bcfb4bb7fcfea5e83b09a386 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_148.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that reference to elements of formal value parameters can be used as inout formal template parameters of test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to inout formal template parameters shall be variables, +// template variables, formal value or template parameters (of in, inout or out +// parameterization) of the current scope or references to elements of (template) variables +// or formal (template) parameters of structured types. + +module Sem_050402_actual_parameters_148 { + + type component GeneralComp { + } + + type record R { + integer field1 + } + + testcase TC_Sem_050402_actual_parameters_148(inout template(present) integer p_val) runs on GeneralComp { + if (match(11, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + function f_caller(in template(present) R p_param) { + execute(TC_Sem_050402_actual_parameters_148(p_param.field1)); // tested parameter passing + } + + control { + f_caller({field1 := 11 }); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_149.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_149.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..921cb7baf4304ab13a18722569f408d12b21b864 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_149.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of in formal value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to in formal value or template parameters +// contain a value or template reference, rules for using references on the right hand +// side of assignments apply. + +module Sem_050402_actual_parameters_149 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(in integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_149() runs on GeneralComp { + var R v_rec := { + field1 := 1, + field2 := { + subfield1 := 2, + subfield2 := 3 + } + } + f_test(v_rec.field2.subfield1); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_149()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_150.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_150.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5183ea7bea7c9cbe0a7d360e7cbadc05c781c176 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_150.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of in formal template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to in formal value or template parameters +// contain a value or template reference, rules for using references on the right hand +// side of assignments apply. + +module Sem_050402_actual_parameters_150 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + template R mw_rec := { + field1 := 1, + field2 := ? + } + + function f_test(in template integer p_val) { + if (match(255, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_150() runs on GeneralComp { + f_test(mw_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + } + + control { + execute(TC_Sem_050402_actual_parameters_150()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_151.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_151.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd79562de25921313ac72be348c9c88a77c721f3 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_151.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of out formal value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module Sem_050402_actual_parameters_151 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(out integer p_val) { + p_val := 10; + } + + testcase TC_Sem_050402_actual_parameters_151() runs on GeneralComp { + var R v_rec := { + field1 := 1, + field2 := { + subfield1 := 2, + subfield2 := 3 + } + }; + f_test(v_rec.field2.subfield1); // tested parameter passing + if (v_rec.field2.subfield1 == 10) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_Sem_050402_actual_parameters_151()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_152.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_152.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8673279a948ec67a59bf47aad95691699ca0299 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_152.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of out formal template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module Sem_050402_actual_parameters_152 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(out template integer p_val) { + p_val := 10; + } + + testcase TC_Sem_050402_actual_parameters_152() runs on GeneralComp { + var template R v_rec := { + field1 := 1, + field2 := ? + }; + f_test(v_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + if (match(valueof(v_rec.field2.subfield1), 10) and match(0, v_rec.field2.subfield2)) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_Sem_050402_actual_parameters_152()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_153.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_153.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a2b45dafd740185bad07a884251c52921dddb0f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_153.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of inout formal value parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module Sem_050402_actual_parameters_153 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(inout integer p_val) { + if (p_val == 2) { setverdict(pass); } + else { setverdict(fail); } + p_val := 10; + } + + testcase TC_Sem_050402_actual_parameters_153() runs on GeneralComp { + var R v_rec := { + field1 := 1, + field2 := { + subfield1 := 2, + subfield2 := 3 + } + }; + f_test(v_rec.field2.subfield1); // tested parameter passing + if (v_rec.field2.subfield1 == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_153()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_154.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_154.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e1c8f0be4685afc214c9140769b607cf93c6a7a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_154.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.4.2, verify that referencing rules are correctly applied to actual parameters of inout formal template parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When actual parameters that are passed to inout and out formal value or template +// parameters contain a value or template reference, rules for using references on +// the left hand side of assignments apply. + +module Sem_050402_actual_parameters_154 { + + type component GeneralComp { + } + + type record R { + integer field1, + record { + integer subfield1, + integer subfield2 + } field2 optional + } + + function f_test(inout template(present) integer p_val) { + if (match(25, p_val)) { setverdict(pass); } + else { setverdict(fail); } + p_val := 10; + } + + testcase TC_Sem_050402_actual_parameters_154() runs on GeneralComp { + var template(present) R v_rec := { + field1 := 1, + field2 := ? + }; + f_test(v_rec.field2.subfield1); // tested parameter passing (using referencing rules specified at 15.6.2) + if (match(valueof(v_rec.field2.subfield1), 10) and match(0, v_rec.field2.subfield2)) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_Sem_050402_actual_parameters_154()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_155.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_155.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..879a1cee89c13974d6569fbb7104f1fb7b900a5e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_155.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out formal parameters are passed to actual parameter in correct (list notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The values of out formal parameters are passed to the actual parameters in the same +// order as is the order of formal parameters in the definition of the parameterized +// TTCN-3 object. + +module Sem_050402_actual_parameters_155 { + + type component GeneralComp { + } + + function f_test(out integer p_val1, out integer p_val2, out integer p_val3) { + p_val1 := 1; + p_val2 := 2; + p_val3 := 3; + } + + testcase TC_Sem_050402_actual_parameters_155() runs on GeneralComp { + var integer v_val; + f_test(v_val, v_val, v_val); // tested parameter passing + if (v_val == 3) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_Sem_050402_actual_parameters_155()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_156.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_156.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05ab10d7c87596811141b136a3f3e8e2eea01f11 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_156.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out formal parameters are passed to actual parameter in correct (assignment notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The values of out formal parameters are passed to the actual parameters in the same +// order as is the order of formal parameters in the definition of the parameterized +// TTCN-3 object. + +module Sem_050402_actual_parameters_156 { + + type component GeneralComp { + } + + function f_test(out integer p_val1, out integer p_val2, out integer p_val3) { + p_val1 := 1; + p_val2 := 2; + p_val3 := 3; + } + + testcase TC_Sem_050402_actual_parameters_156() runs on GeneralComp { + var integer v_val; + f_test(p_val3 := v_val, p_val2 := v_val, p_val1 := v_val); // tested parameter passing + if (v_val == 3) { setverdict(pass); } + else { setverdict(fail); } + + } + + control { + execute(TC_Sem_050402_actual_parameters_156()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_157.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_157.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a078c54bded8cca390e854fe40c363d0cf51ad9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_157.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that component timers can be passed to timer parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal timer parameters shall be component +// timers, local timers or formal timer parameters of the current scope. + +module Sem_050402_actual_parameters_157 { + + type component GeneralComp { + timer tc_tmr := 5.0; + } + + function f_test(timer t_par) { + t_par.stop; + } + + testcase TC_Sem_050402_actual_parameters_157() runs on GeneralComp { + tc_tmr.start; + f_test(tc_tmr); // tested parameter passing + if (not tc_tmr.running) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_157()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_158.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_158.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f29bbb4fef3730585de0236f78029f54bb1ad10 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_158.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that component timers can be passed to timer parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal timer parameters shall be component +// timers, local timers or formal timer parameters of the current scope. + +module Sem_050402_actual_parameters_158 { + + type component GeneralComp { + } + + function f_test(timer t_par) { + t_par.stop; + } + + testcase TC_Sem_050402_actual_parameters_158() runs on GeneralComp { + timer t_tmr := 5.0; + t_tmr.start; + f_test(t_tmr); // tested parameter passing + if (not t_tmr.running) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_158()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_159.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_159.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73fb6a8cc4602324ad88d96bec14f005eaef2561 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_159.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that timer parameters can be passed to timer parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal timer parameters shall be component +// timers, local timers or formal timer parameters of the current scope. + +module Sem_050402_actual_parameters_159 { + + type component GeneralComp { + } + + function f_test(timer t_par) { + t_par.stop; + } + + function f_caller(timer t_par) { + f_test(t_par); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_159() runs on GeneralComp { + timer t_tmr := 5.0; + t_tmr.start; + f_caller(t_tmr); // this parameter passing is not a subject of the test + if (not t_tmr.running) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_159()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_160.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_160.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e4d9b05611089341dba5c74b76197614904324e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_160.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that component ports can be passed to port parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal port parameters shall be component +// ports or formal port parameters of the current scope. + +module Sem_050402_actual_parameters_160 { + + type port IntPort message { + inout integer; + } + + type component GeneralComp { + port IntPort p; + } + + function f_test(IntPort p_port) { + p_port.stop; + } + + testcase TC_Sem_050402_actual_parameters_160() runs on GeneralComp { + f_test(p); // tested parameter passing + if (p.checkstate("Stopped")) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_160()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_161.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_161.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1c6153ad99083719ddf7cf98752e9b929c74dcb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_161.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that port parameters can be passed to port parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to formal port parameters shall be component +// ports or formal port parameters of the current scope. + +module Sem_050402_actual_parameters_161 { + + type port IntPort message { + inout integer; + } + + type component GeneralComp { + port IntPort p; + } + + function f_test(IntPort p_port) { + p_port.stop; + } + + function f_caller(IntPort p_port) { + f_test(p_port); // tested parameter passing + } + + testcase TC_Sem_050402_actual_parameters_161() runs on GeneralComp { + f_test(p); // this component port passing is not a subject of this test + if (p.checkstate("Stopped")) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_161()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_162.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_162.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6260902544d21a051544d47ffb09d9eb0dc48e41 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_162.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters override default values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When a formal parameter has been defined with a default value or template, +// respectively, then it is not necessary to provide an actual parameter. + +module Sem_050402_actual_parameters_162 { + + type component GeneralComp { + } + + function f_test(integer p_val := 5) { + if (p_val != 5) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_162() runs on GeneralComp { + f_test(0); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_162()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_163.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_163.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5313bf7e9b488e49b326c5211d2eaf4885f5b7a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_163.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that default values are used if actual parameters are missing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When a formal parameter has been defined with a default value or template, +// respectively, then it is not necessary to provide an actual parameter. + +module Sem_050402_actual_parameters_163 { + + type component GeneralComp { + } + + function f_test(integer p_val := 5) { + if (p_val == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_163() runs on GeneralComp { + f_test(-); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_163()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_164.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_164.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5260c1c29f89f61f92e1933793e03e08b2a91a1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_164.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters override default templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When a formal parameter has been defined with a default value or template, +// respectively, then it is not necessary to provide an actual parameter. + +module Sem_050402_actual_parameters_164 { + + type component GeneralComp { + } + + function f_test(template integer p_val := (0..5)) { + if (match(10, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_164() runs on GeneralComp { + f_test(?); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_164()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_165.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_165.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46afed1bb8c73d90ec3def892737005238826063 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_165.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that default templates are used if actual parameters are missing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When a formal parameter has been defined with a default value or template, +// respectively, then it is not necessary to provide an actual parameter. + +module Sem_050402_actual_parameters_165 { + + type component GeneralComp { + } + + function f_test(template integer p_val := (0..5)) { + if (match(3, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_165() runs on GeneralComp { + f_test(-); // tested parameter passing + } + + control { + execute(TC_Sem_050402_actual_parameters_165()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_166.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_166.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae3cdc03786ea714f5bcc4ab8ae9b4d82b9904d8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_166.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters are evaluated in order of their appearance (list notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameters are evaluated in the order of their appearance. + +module Sem_050402_actual_parameters_166 { + + type component GeneralComp { + var integer vc_counter := 0; + } + + function f_eval1() runs on GeneralComp return integer { + if (vc_counter == 0) + { + setverdict(pass); + vc_counter := vc_counter + 1; + } + else { setverdict(fail); } + return vc_counter; + } + + function f_eval2() runs on GeneralComp return integer { + if (vc_counter == 1) + { + setverdict(pass); + vc_counter := vc_counter + 1; + } + else { setverdict(fail); } + return vc_counter; + } + + function f_test(integer p_par1, integer p_par2) { + } + + testcase TC_Sem_050402_actual_parameters_166() runs on GeneralComp { + f_test(f_eval1(), f_eval2()); // tested feature: f_eval1 shall be called before f_eval2 + } + + control { + execute(TC_Sem_050402_actual_parameters_166()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_167.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_167.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad48b113f5f3ce00e6c8281bfa73804a2f51ca08 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_167.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters are evaluated in order of their appearance (assignment notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameters are evaluated in the order of their appearance. + +module Sem_050402_actual_parameters_167 { + + type component GeneralComp { + var integer vc_counter := 0; + } + + function f_eval1() runs on GeneralComp return integer { + log("f_eval1"); + if (vc_counter == 0) + { + setverdict(pass); + vc_counter := vc_counter + 1; + } + else { setverdict(fail); } + return vc_counter; + } + + function f_eval2() runs on GeneralComp return integer { + log("f_eval2"); + if (vc_counter == 1) + { + setverdict(pass); + vc_counter := vc_counter + 1; + } + else { setverdict(fail); } + return vc_counter; + } + + function f_test(integer p_par1, integer p_par2) { + } + + testcase TC_Sem_050402_actual_parameters_167() runs on GeneralComp { + f_test(p_par2 := f_eval1(), p_par1 := f_eval2()); // tested feature: f_eval1 shall be called before f_eval2 + } + + control { + execute(TC_Sem_050402_actual_parameters_167()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_168.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_168.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..248307b77c9c524614e53237b507dbc9a128f3bd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_168.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that rules for referencing are applied to actual paremeters before passing to out formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Before passing the actual parameter, the rules for referencing the element on +// the left hand side of assignments are applied, expanding the structured value +// so that the referenced element becomes accessible (see clauses 6.2 and 15.6 for +// more details). + +module Sem_050402_actual_parameters_168 { + + type component GeneralComp { + var integer vc_index := 0; + } + + type record of integer RI; + + function f_test(out integer p_par1) runs on GeneralComp { + vc_index := 1; + p_par1 := 10; + } + + testcase TC_Sem_050402_actual_parameters_168() runs on GeneralComp { + var RI v_ri := { 1, 2 } + f_test(v_ri[vc_index]); // tested parameter passing + if (v_ri == { 10, 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_168()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_169.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_169.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eabb28d3fa4c9a7bf3b53fc57054a986023181e4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_169.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that rules for referencing are applied to actual paremeters before passing to inout formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Before passing the actual parameter, the rules for referencing the element on +// the left hand side of assignments are applied, expanding the structured value +// so that the referenced element becomes accessible (see clauses 6.2 and 15.6 for +// more details). + +module Sem_050402_actual_parameters_169 { + + type component GeneralComp { + var integer vc_index := 0; + } + + type record of integer RI; + + function f_test(inout integer p_par1) runs on GeneralComp { + vc_index := 1; + p_par1 := 10; + } + + testcase TC_Sem_050402_actual_parameters_169() runs on GeneralComp { + var RI v_ri := { 1, 2 } + f_test(v_ri[vc_index]); // tested parameter passing + if (v_ri == { 10, 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_169()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_170.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_170.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dea386868c89cca686da955301f429a577595c8d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_170.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that default parameters are evaluated in order of the formal parameter list (list notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If for some formal parameters no actual parameter has been provided, their default +// values are taken and evaluated in the order of the formal parameter list. + +module Sem_050402_actual_parameters_170 { + + type component GeneralComp { + } + + function f_eval1() return integer { + setverdict(pass); + return 1; + } + + function f_eval2() return integer { + if (getverdict != pass) { setverdict(fail); } // if f_eval was called, the verdict would be already pass + return 2; + } + + function f_test(integer p_par1, integer p_par2 := f_eval1(), integer p_par3 := f_eval2()) { + } + + testcase TC_Sem_050402_actual_parameters_170() runs on GeneralComp { + f_test(0, -, -); // tested feature: f_eval1 shall be called before f_eval2 + } + + control { + execute(TC_Sem_050402_actual_parameters_170()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_171.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_171.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46a46ba04bebd133c514dadb43c38827af2cd350 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_171.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that default parameters are evaluated in order of the formal parameter list (assignment notation) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If for some formal parameters no actual parameter has been provided, their default +// values are taken and evaluated in the order of the formal parameter list. + +module Sem_050402_actual_parameters_171 { + + type component GeneralComp { + } + + function f_eval1() return integer { + setverdict(pass); + return 1; + } + + function f_eval2() return integer { + if (getverdict != pass) { setverdict(fail); } // if f_eval was called, the verdict would be already pass + return 2; + } + + function f_test(integer p_par1 := f_eval1(), integer p_par2, integer p_par3 := f_eval2()) { + } + + testcase TC_Sem_050402_actual_parameters_171() runs on GeneralComp { + f_test(p_par2 := 0); // tested feature: f_eval1 shall be called before f_eval2 + } + + control { + execute(TC_Sem_050402_actual_parameters_171()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_172.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_172.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3219ba2996fcd69e91bbd170f1c4f66bdf246152 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_172.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that it is possible to use parametrized template with no parentheses if all parameters have default values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The empty brackets for instances of parameterized templates that have only parameters +// with default values are optional when no actual parameters are provided, i.e. all +// formal parameters use their default values. + +module Sem_050402_actual_parameters_172 { + + type component GeneralComp { + } + + template integer mw_int (integer p_val := 10):= (0..p_val); + + testcase TC_Sem_050402_actual_parameters_172() runs on GeneralComp { + if (match(5, mw_int)) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_172()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_173.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_173.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f04a4db2ebd8227e602dca85ccaecf230b83e283 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_173.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that it is possible to use parametrized template with empty parentheses + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The empty brackets for instances of parameterized templates that have only parameters +// with default values are optional when no actual parameters are provided, i.e. all +// formal parameters use their default values. + +module Sem_050402_actual_parameters_173 { + + type component GeneralComp { + } + + template integer mw_int (integer p_val := 10):= (0..p_val); + + testcase TC_Sem_050402_actual_parameters_173() runs on GeneralComp { + if (match(5, mw_int())) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_173()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_174.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_174.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a151261162b48b2aeb797dffd0d66730c28f61bb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_174.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameter values override default values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameter of a formal parameter with default value can be skipped by using +// dash "-" as actual parameter. + +module Sem_050402_actual_parameters_174 { + + type component GeneralComp { + } + + function f_test (integer p_val := 10) { + if (p_val != 10) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_174() runs on GeneralComp { + f_test(0); + } + + control { + execute(TC_Sem_050402_actual_parameters_174()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_175.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_175.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3735f4a6a35ba33f7b00959e663e0534055af86f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_175.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters in the beginning of list notation can be skipped + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameter of a formal parameter with default value can be skipped by using +// dash "-" as actual parameter. + +module Sem_050402_actual_parameters_175 { + + type component GeneralComp { + } + + function f_test (integer p_val1 := 10, integer p_val2) { + if (match(p_val1, 10) and match(p_val2, 2)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_175() runs on GeneralComp { + f_test(-, 2); + } + + control { + execute(TC_Sem_050402_actual_parameters_175()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_176.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_176.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d8626dbe429fa422f65931b6a91b8fb083745f6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_176.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that multiple actual parameters of list notation can be skipped + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameter of a formal parameter with default value can be skipped by using +// dash "-" as actual parameter. + +module Sem_050402_actual_parameters_176 { + + type component GeneralComp { + } + + function f_test (integer p_val1, integer p_val2 := 20, integer p_val3, integer p_val4 := 40, integer p_val5) { + if ( match(p_val1, 1) and match(p_val2, 20) and match(p_val3, 3) and match(p_val4, 40) and match(p_val5, 5)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_176() runs on GeneralComp { + f_test(1, -, 3, -, 5); + } + + control { + execute(TC_Sem_050402_actual_parameters_176()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_177.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_177.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c76eadb1bab22b71b0748c7a460a041fd7f1ad1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_177.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual parameters at the end of list notation can be explicitly skipped + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameter of a formal parameter with default value can be skipped by using +// dash "-" as actual parameter. + +module Sem_050402_actual_parameters_177 { + + type component GeneralComp { + } + + function f_test (integer p_val1, integer p_val2 := 20) { + if (match(p_val1, 1) and match(p_val2, 20)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_177() runs on GeneralComp { + f_test(1, -); + } + + control { + execute(TC_Sem_050402_actual_parameters_177()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_178.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_178.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a10977efeabe6afdfb7f3c158ecdcefe9b691caf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_178.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that missing actual parameters at the end of list notation are considered to be skipped (single parameter) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual +// parameter follows in the actual parameter list - either because the parameter is +// last or because all following formal parameters have default values and are left out. + +module Sem_050402_actual_parameters_178 { + + type component GeneralComp { + } + + function f_test (integer p_val1, integer p_val2 := 20) { + if (match(p_val1, 1) and match(p_val2, 20)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_178() runs on GeneralComp { + f_test(1); + } + + control { + execute(TC_Sem_050402_actual_parameters_178()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_179.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_179.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bab24a9487f1e755df01a0c0eb35032ec3149592 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_179.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that missing actual parameters at the end of list notation are considered to be skipped (multiple parameter) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual +// parameter follows in the actual parameter list - either because the parameter is +// last or because all following formal parameters have default values and are left out. + +module Sem_050402_actual_parameters_179 { + + type component GeneralComp { + var integer vc_counter := 0; + } + + function f_test (integer p_val1, integer p_val2 := 20, integer p_val3 := 30, integer p_val4 := 40) { + if (match(p_val1, 1) and match(p_val2, 20) and match(p_val3, 30) and match(p_val4, 40)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_179() runs on GeneralComp { + f_test(1, -); + } + + control { + execute(TC_Sem_050402_actual_parameters_179()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_180.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_180.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15d8903b06f546b945fd07e0bdb757ba5e366d0a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_180.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that assignment notation containing all parameters in declaration order is accepted + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each formal parameter without default value, there shall be an actual parameter. + +module Sem_050402_actual_parameters_180 { + + type component GeneralComp { + } + + function f_test (integer p_val1, charstring p_val2, integer p_val3) { + if ( match(p_val1, 1) and match(p_val2, "test") and match(p_val3, 3)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_180() runs on GeneralComp { + f_test(p_val1 := 1, p_val2 := "test", p_val3 := 3); + } + + control { + execute(TC_Sem_050402_actual_parameters_180()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_181.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_181.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de1c866a4db1cb1d6e5ae8483995feeed02f92ce --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_181.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that assignment notation containing all parameters in random order is accepted + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each formal parameter without default value, there shall be an actual parameter. + +module Sem_050402_actual_parameters_181 { + + type component GeneralComp { + } + + function f_test (integer p_val1, charstring p_val2, integer p_val3) { + if ( match(p_val1, 1) and match(p_val2, "test") and match(p_val3, 3)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_181() runs on GeneralComp { + f_test(p_val3 := 3, p_val1 := 1, p_val2 := "test"); + } + + control { + execute(TC_Sem_050402_actual_parameters_181()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_182.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_182.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b1390b25fa65d6ed891ce20ce01f597f81adff1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_182.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that assignment notation can omit parameters with default value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In order to use the default value of a formal parameter, no assignment for this +// specific parameter shall be provided. + +module Sem_050402_actual_parameters_182 { + + type component GeneralComp { + } + + function f_test (integer p_val1 := 10, charstring p_val2, integer p_val3) { + if ( match(p_val1, 10) and match(p_val2, "test") and match(p_val3, 3)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_182() runs on GeneralComp { + f_test(p_val2 := "test", p_val3 := 3); + } + + control { + execute(TC_Sem_050402_actual_parameters_182()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_183.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_183.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1e4efe7d8535cad3272e5ba45d2d62c45414d78 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_183.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible values can be passed to in formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The type of each actual parameter shall be compatible with the type of each +// corresponding formal parameter. + +module Sem_050402_actual_parameters_183 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + type record R2 { + integer elem1, + integer elem2 optional + } + + function f_test (R1 p_val) { + if (p_val == { field1 := 1, field2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_183() runs on GeneralComp { + var R2 v_rec := { 1, 2 }; + f_test(v_rec); + } + + control { + execute(TC_Sem_050402_actual_parameters_183()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_184.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_184.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67bf310fd4d2ea36aa5c2ac3ef0ab8ae9febfa68 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_184.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible values can be passed from out formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The type of each actual parameter shall be compatible with the type of each +// corresponding formal parameter. + +module Sem_050402_actual_parameters_184 { + + type component GeneralComp { + } + + type record R1 { + integer field1, + integer field2 optional + } + + type record R2 { + integer elem1, + integer elem2 optional + } + + function f_test (out R1 p_val) { + p_val.field1 := 1; + p_val.field2 := 2; + } + + testcase TC_Sem_050402_actual_parameters_184() runs on GeneralComp { + var R2 v_rec; + f_test(v_rec); + if (v_rec == { elem1 := 1, elem2 := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_184()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_185.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_185.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80355dce6373d7d1682c19fa2d6005b7f71cb1fe --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_185.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible templates can be passed to template parameters with omit restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module Sem_050402_actual_parameters_185 { + + type component GeneralComp { + } + + function f_test (omit integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_185() runs on GeneralComp { + f_test(1); + } + + control { + execute(TC_Sem_050402_actual_parameters_185()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_186.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_186.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..166791c5b891e2beee187cfa4f29ce0602688377 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_186.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible templates can be passed to template parameters with value restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module Sem_050402_actual_parameters_186 { + + type component GeneralComp { + } + + function f_test (template(value) integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_186() runs on GeneralComp { + f_test(1); + } + + control { + execute(TC_Sem_050402_actual_parameters_186()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_187.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_187.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6e8e1cd91b5f769c7dc82bf8485c785503c43c2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_187.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that compatible templates can be passed to template parameters with present restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters passed to restricted formal template parameters shall obey +// the restrictions given in clause 15.8. + +module Sem_050402_actual_parameters_187 { + + type component GeneralComp { + } + + function f_test (template(present) integer p_val) { + if (match(1, p_val)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_187() runs on GeneralComp { + f_test((0..10)); + } + + control { + execute(TC_Sem_050402_actual_parameters_187()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_188.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_188.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d81031b84eefe64ea233e79e9712d1ea3402fef5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_188.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that it is possible to use nested actual parameter lists + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// All parameterized entities specified as an actual parameter shall have their +// own parameters resolved in the top-level actual parameter list. + +module Sem_050402_actual_parameters_188 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } + + template integer mw_int (integer p_upper) := (0..p_upper); + + template R mw_rec(template integer p_field2) := { + field1 := 1, + field2 := p_field2 + } + + function f_test (template R p_match) { + if (match({1, 5}, p_match)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_188() runs on GeneralComp { + f_test(mw_rec(mw_int(10))); + } + + control { + execute(TC_Sem_050402_actual_parameters_188()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_189.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_189.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9291b96d01d06f0f1f5a51932ceb1afeab6511c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_189.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that empty actual parameter list can be used for functions with no parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module Sem_050402_actual_parameters_189 { + + type component GeneralComp { + } + + function f_test () { + setverdict(pass); + } + + testcase TC_Sem_050402_actual_parameters_189() runs on GeneralComp { + f_test(); + } + + control { + execute(TC_Sem_050402_actual_parameters_189()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_190.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_190.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5c21e05cbee364a4b7b121eaf11f4c09b7715d2 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_190.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that empty actual parameter list can be used for altsteps with no parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the formal parameter list of TTCN-3 objects function, testcase, signature, +// altstep or external function is empty, then the empty parentheses shall be +// included both in the declaration and in the invocation of that object. In all +// other cases the empty parentheses shall be omitted. + +module Sem_050402_actual_parameters_190 { + + type component GeneralComp { + } + + altstep a_test () { + [] any timer.timeout { setverdict(pass); } + } + + testcase TC_Sem_050402_actual_parameters_190() runs on GeneralComp { + timer t_instant := 0.0; + t_instant.start; + a_test(); + } + + control { + execute(TC_Sem_050402_actual_parameters_190()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_191.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_191.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a96f31fc6c3009ab1440fb2d963f95acfa53d01 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_191.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that partially initialized values can be passed to in formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Unless specified differently in the relevant clause(s), actual parameters +// passed to in or inout formal parameters shall be at least partially +// initialized (for an exemption see e.g. clause 16.1.2 of the present document). + +module Sem_050402_actual_parameters_191 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + function f_test (R p_val) { + if (match(p_val.field1, 1) and not isbound(p_val.field2)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_191() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + f_test(v_rec); + } + + control { + execute(TC_Sem_050402_actual_parameters_191()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_192.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_192.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e51fa46aeb4253a34a3a8b7c00569ab0114149e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_192.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that partially initialized values can be passed to inout formal parameters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Unless specified differently in the relevant clause(s), actual parameters +// passed to in or inout formal parameters shall be at least partially +// initialized (for an exemption see e.g. clause 16.1.2 of the present document). + +module Sem_050402_actual_parameters_192 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + function f_test (inout R p_val) { + if (match(p_val.field1, 1) and not isbound(p_val.field2)) { setverdict(pass); } + else { setverdict(fail); } + } + + testcase TC_Sem_050402_actual_parameters_192() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + f_test(v_rec); + } + + control { + execute(TC_Sem_050402_actual_parameters_192()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_193.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_193.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71c97abc57dbf8f29cfc9a072eeb6af01230b814 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_193.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that Example 1 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_193 { + + type component GeneralComp { + } + + // A function definition with a formal parameter list + function MyFunction(integer FormalPar1, boolean FormalPar2, bitstring FormalPar3) { + setverdict(pass); + } + + testcase TC_Sem_050402_actual_parameters_193() runs on GeneralComp { + // A function call with an actual parameter list + MyFunction(123, true,'1100'B); + // A function call with assignment notation for actual parameters + MyFunction(FormalPar1 := 123, FormalPar3 := '1100'B, FormalPar2 := true); + } + + control { + execute(TC_Sem_050402_actual_parameters_193()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_194.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_194.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2906a6a8e1f5d0121a44e3570cf6f413be82ad90 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_194.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that Example 2 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_194 { + + type component GeneralComp { + } + + type integer MyTemplateType; + + template MyTemplateType MyGlobalTemplate := ?; + + function MyFunction(in template MyTemplateType MyValueParameter){ + setverdict(pass); + }; + // MyValueParameter is in parameter, the in keyword is optional + + testcase TC_Sem_050402_actual_parameters_194() runs on GeneralComp { + // A function call with an actual parameter + MyFunction(MyGlobalTemplate); + } + + control { + execute(TC_Sem_050402_actual_parameters_194()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_195.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_195.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7683b0af4ac8e8c350b655ad4924a905d5f9fdca --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_195.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the first part of the Example 3 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_195 { + + type component GeneralComp { + } + + function MyFunction(inout boolean MyReferenceParameter) { + // MyReferenceParameter is an inout parameter + setverdict(pass); + } + + testcase TC_Sem_050402_actual_parameters_195() runs on GeneralComp { + var boolean MyBooleanVariable := false; + // A function call with an actual parameter + MyFunction(MyBooleanVariable); + // The actual parameter can be read and set within the function + } + + control { + execute(TC_Sem_050402_actual_parameters_195()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_196.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_196.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9fb740ba32bf4a762ac96d84254422f77dcbba9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_196.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the third part of the Example 3 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_196 { + + type component GeneralComp { + } + + type record of integer RoI; + + function f_swapElements (inout integer p_int1, inout integer p_int2) { + var integer v_tmp := p_int1; + p_int1 := p_int2; + p_int2 := v_tmp; + } + + testcase TC_Sem_050402_actual_parameters_196() runs on GeneralComp { + var RoI v_roi := { 0, 1, 2, 3, 4, 5 }; + f_swapElements(v_roi[0], v_roi[5]); // after the function call, v_roi is { 5, 1, 2, 3, 4, 0 } + if (v_roi == { 5, 1, 2, 3, 4, 0 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_196()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_197.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_197.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f79a553081216893f36a6844a6c895433fb68e5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_197.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the first part of the Example 3 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_197 { + + type component GeneralComp { + } + + function MyFunction(inout boolean MyReferenceParameter) { + // MyReferenceParameter is an inout parameter + setverdict(pass); + } + + testcase TC_Sem_050402_actual_parameters_197() runs on GeneralComp { + var boolean MyBooleanVariable := false; + // A function call with an actual parameter + MyFunction(MyBooleanVariable); + // The actual parameter can be read and set within the function + } + + control { + execute(TC_Sem_050402_actual_parameters_197()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_198.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_198.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f579bab6ba61a2409219ae33c69a320fd425a8fc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_198.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the the Example 4 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_198 { + + type component GeneralComp { + } + + // A function definition with an empty parameter list shall be written as + function MyFunction() { setverdict(pass); } + + // A record definition with an empty parameter list shall be written as + type record MyRecord { } + // and shall be used as + template MyRecord Mytemplate := { } + + testcase TC_Sem_050402_actual_parameters_198() runs on GeneralComp { + // and shall be called as + MyFunction(); + } + + control { + execute(TC_Sem_050402_actual_parameters_198()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_199.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_199.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a68378155277b7de99e6e98b8d6544776651afe --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_199.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the Example 5 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_199 { + + type port P message { + inout MyMessageType; + } + + type component GeneralComp { + port P MyPCO; + } + + // Given the message definition + type record MyMessageType + { + integer field1, + charstring field2, + boolean field3 + } + + // A message template might be + template MyMessageType MyTemplate(integer MyValue) := + { + field1 := MyValue, + field2 := pattern "abc*xyz", + field3 := true + } + + testcase TC_Sem_050402_actual_parameters_199(template MyMessageType RxMsg) runs on GeneralComp { + MyPCO.send(MyMessageType:{7, "abcdefxyz", true }); + MyPCO.receive(RxMsg); + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_199(MyTemplate(7))); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_200.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_200.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad106ab9dd8a5bce543f55a8a5ba61127f6fe33d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_200.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the Example 6 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_200 { + + type component GeneralComp { + } + + modulepar boolean logMessage := true; + function logMsg(@lazy charstring complex) { + if (logMessage) { + log(complex); + } + } + + function computeComplexMessage() return charstring { + // some complicated computation + setverdict(pass); + return "hello"; + } + + testcase TC_Sem_050402_actual_parameters_200() runs on GeneralComp { + logMsg(computeComplexMessage()); // computeComplexMessage() is only invoked if + // logMessage is true + } + + control { + execute(TC_Sem_050402_actual_parameters_200()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_201.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_201.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a941ad4979710be63d6ec53d95942cadd12f1384 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_201.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the Example 7 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_201 { + + type component GeneralComp { + var integer v_id; + port MyPortType P; + } + + type record MyMessage { integer id, float number } + type port MyPortType message { inout MyMessage } + + function sendLazy(@lazy MyMessage pdu) runs on GeneralComp { + for (v_id := 1; v_id<9; v_id:=v_id+1){ + P.send(pdu); // the actual parameter passed to the formal parameter pdu is evaluated only in + // the first loop;let say rnd() returns 0.924946; the message { 1, 0.924946 } is + // sent out 8 times + } + setverdict(pass,"messages has been sent out") + } + function sendFuzzy(@fuzzy MyMessage pdu) runs on GeneralComp { + for (v_id := 1; v_id<9; v_id:=v_id+1){ + P.send(pdu); // the actual parameter passed to the formal parameter pdu is evaluated in each + // loop; let say rnd() returns 0.924946, 0.680497, 0.630836, 0.648681, 0.428501, + // 0.262539, 0.646990, 0.265262 in subsuent calls; the messages 1, 0.924946 }, + // {{ 2, 0.680497 }, { 3, 0.630836 }, { 4, 0.648681 }, { 5, 0.428501 }, + // { 6, 0.262539 }, { 7, 0.646990 } and { 8, 0.265262 } are sent out in sequence + } + setverdict(pass,"messages has been sent out") + } + + testcase TC_Sem_050402_actual_parameters_201() runs on GeneralComp system GeneralComp { + connect(self:P,self:P); + sendLazy({v_id, rnd()}); //note that at this point v_id is unintialized yet + sendFuzzy({v_id, rnd()}) + } + + control { + execute(TC_Sem_050402_actual_parameters_201()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_202.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_202.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e47ba261e45021fe379e44376e0dce1026b84d0e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_202.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that the Example 8 can be executed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_050402_actual_parameters_202 { + + type component GeneralComp { + } + + function f_initValues (out integer p_par1, out integer p_par2) { + p_par1 := 1; + p_par2 := 2; + } + + testcase TC_Sem_050402_actual_parameters_202() runs on GeneralComp { + var integer v_var1; + f_initValues(p_par2 := v_var1, p_par1 := v_var1); + // After this function call, v_var1 will contain 2, as parameters are assigned in + // the same order as in the definition of the f_initValues function. Thus p_par1 is + // assigned first to v_var1 and p_par2 after that ovewriting the previous value. + if (v_var1 == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_050402_actual_parameters_202()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_203.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_203.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..602346c39737a403d42637b966d6021628789a67 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_203.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_203 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_Sem_050402_actual_parameters_203() runs on GeneralComp { + var integer v_val := 5; + f_test(v_val); // tested parameter passing + if (v_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_203()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_204.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_204.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..366d518f1e653e36612e01db8268e41d4c765ecf --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_204.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_204 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_Sem_050402_actual_parameters_204() runs on GeneralComp { + var integer v_val := 5; + f_test(v_val); // tested parameter passing + if (v_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_204()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_205.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_205.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..736167f2fc3464663ccc047ad7b17947a396bdf7 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_205.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_205 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(integer p_val) { + f_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_205() runs on GeneralComp { + f_caller(0); + } + + control { + execute(TC_Sem_050402_actual_parameters_205()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_206.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_206.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f3d4f7dd0dcc57030f58258c446c3ef2e38b90c --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_206.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_206 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(out integer p_val) { + f_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_206() runs on GeneralComp { + var integer v_val; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_206()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_207.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_207.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca984083f4accabd2cbe76dee67e42e17c96ddcb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_207.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_207 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(inout integer p_val) { + f_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_207() runs on GeneralComp { + var integer v_val := 1; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_207()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_208.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_208.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..939a86a537e3b70748275a876daf0891092bf9f1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_208.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in template parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_208 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(template integer p_val) { + f_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_208() runs on GeneralComp { + f_caller(?); + } + + control { + execute(TC_Sem_050402_actual_parameters_208()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_209.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_209.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7bcf54106270fcfdfb810dc8f6b7b55357638b25 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_209.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out template parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_209 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(out template integer p_val) { + f_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_209() runs on GeneralComp { + var template integer v_val; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_209()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_210.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_210.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88f390c54c3c0c85a6a58e047db51a6d94b604ff --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_210.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout template parameters can be used as actual out value parameters of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_210 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + function f_caller(inout template integer p_val) { + f_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_210() runs on GeneralComp { + var template integer v_val := ?; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_210()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_211.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_211.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b46d24d658385eee798552d5fb02f9056f9eb772 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_211.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that dash can be used as an actual out value parameter of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_211 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_Sem_050402_actual_parameters_211() runs on GeneralComp { + f_test(-); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_211()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_212.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_212.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd03ebb81b8edc09c716215c304337dcfb65926d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_212.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_212 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_Sem_050402_actual_parameters_212() runs on GeneralComp { + var integer v_val := 5; + timer t_tmr := 0.1; + t_tmr.start; + a_test(v_val); // tested parameter passing + if (v_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_212()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_213.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_213.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66ad994a8193bdf2d59c3be55d39bbc4eff1fa7f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_213.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that variables can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_213 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_Sem_050402_actual_parameters_213() runs on GeneralComp { + var integer v_val := 5; + timer t_tmr := 0.1; + t_tmr.start; + a_test(v_val); // tested parameter passing + if (v_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_050402_actual_parameters_213()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_214.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_214.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b34b8227a31166843146dcd4506b749a2575e8b8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_214.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in value parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_214 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_214() runs on GeneralComp { + f_caller(0); + } + + control { + execute(TC_Sem_050402_actual_parameters_214()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_215.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_215.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6990ae29732ce0c2b0d3473e15e7351779c7d702 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_215.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out value parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_215 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(out integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_215() runs on GeneralComp { + var integer v_val; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_215()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_216.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_216.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..df900886fa95c0dfab8a8b06ed374bf92da98720 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_216.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout value parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_216 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(inout integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (p_val == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_216() runs on GeneralComp { + var integer v_val := 1; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_216()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_217.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_217.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b41597fb8b130dfeb06c8f43634fbae01aa98f8 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_217.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that in template parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_217 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(template integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_217() runs on GeneralComp { + f_caller(?); + } + + control { + execute(TC_Sem_050402_actual_parameters_217()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_218.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_218.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d34567e4b41a5b15cf10451d138e8b07ef737db9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_218.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that out template parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_218 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(out template integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_218() runs on GeneralComp { + var template integer v_val; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_218()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_219.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_219.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea26ab9a859cf9b003f8d9c969ad8d6a538896ab --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_219.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that inout template parameters can be used as actual out value parameters of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_219 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + function f_caller(inout template integer p_val) { + timer t_tmr := 0.1; + t_tmr.start; + a_test(p_val); // tested parameter passing + if (valueof(p_val) == 9) { + setverdict(pass); + }else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_219() runs on GeneralComp { + var template integer v_val := ?; + f_caller(v_val); + } + + control { + execute(TC_Sem_050402_actual_parameters_219()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_220.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_220.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b248905911f544e96a6a8564989cdb73fd564cd --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_220.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that dash can be used as an actual out value parameter of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal value parameters shall be (template) variables, +// formal (template) parameters (of in, inout or out parameterization) or references to elements +// of (template) variables or formal (template) parameters of structured types. Furthermore it is +// allowed to use the dash symbol "-" as an actual out parameter, signifying that a possible result +// for that parameter will not be passed back. + +module Sem_050402_actual_parameters_220 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_Sem_050402_actual_parameters_220() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(-); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_220()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_221.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_221.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fae44ccd300103c8472dd7faea93cc27692af5a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_221.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that dash can be used as an actual out template parameter of functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, formal +// template parameters or references to elements of template variables or formal template parameters of +// structured types. Furthermore it is allowed to use the dash symbol "-" as an actual out parameter, +// signifying that a possible result for that parameter will not be passed back. + +module Sem_050402_actual_parameters_221 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := ? + } + + testcase TC_Sem_050402_actual_parameters_221() runs on GeneralComp { + f_test(-); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_221()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_222.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_222.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c7acbb11b3b7b7df76bacd522215aee92af0298 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_222.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that dash can be used as an actual out template parameter of altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters that are passed to out formal template parameters shall be template variables, formal +// template parameters or references to elements of template variables or formal template parameters of +// structured types. Furthermore it is allowed to use the dash symbol "-" as an actual out parameter, +// signifying that a possible result for that parameter will not be passed back. + +module Sem_050402_actual_parameters_222 { + + type component GeneralComp { + } + + altstep a_test(out template integer p_val) { + [] any timer.timeout { + p_val := ? + } + } + + testcase TC_Sem_050402_actual_parameters_222() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(-); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_222()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_223.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_223.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ee612fbdbbffdc543dbf9bb540eed454350d6c5 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_223.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual out value parameters of functions can be skipped if they are the last ones + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual parameter follows in the actual parameter +// list - either because the parameter is last or because all following formal parameters are out parameters or have default +// values and are left out. + +module Sem_050402_actual_parameters_223 { + + type component GeneralComp { + } + + function f_test(out integer p_val) { + p_val := 9 + } + + testcase TC_Sem_050402_actual_parameters_223() runs on GeneralComp { + f_test(); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_223()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_224.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_224.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f123d3a25686d697693b68835083c6b2bf314df --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_224.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual out value parameters of altsteps can be skipped if they are the last ones + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual parameter follows in the actual parameter +// list - either because the parameter is last or because all following formal parameters are out parameters or have default +// values and are left out. + +module Sem_050402_actual_parameters_224 { + + type component GeneralComp { + } + + altstep a_test(out integer p_val) { + [] any timer.timeout { + p_val := 9 + } + } + + testcase TC_Sem_050402_actual_parameters_224() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(-); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_224()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_225.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_225.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..896ec493f815b4f2da07eaa3870e00d5ddbf7b0d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_225.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual out template parameters of functions can be skipped if they are the last ones + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual parameter follows in the actual parameter +// list - either because the parameter is last or because all following formal parameters are out parameters or have default +// values and are left out. + +module Sem_050402_actual_parameters_225 { + + type component GeneralComp { + } + + function f_test(out template integer p_val) { + p_val := ? + } + + testcase TC_Sem_050402_actual_parameters_225() runs on GeneralComp { + f_test(); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_225()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_226.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_226.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6e3dab61859b3544ba13aea62149c4e4b80b606 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_226.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that actual out template parameters of altsteps can be skipped if they are the last ones + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An actual parameter can also be skipped by just leaving it out if no other actual parameter follows in the actual parameter +// list - either because the parameter is last or because all following formal parameters are out parameters or have default +// values and are left out. + +module Sem_050402_actual_parameters_226 { + + type component GeneralComp { + } + + altstep a_test(out template integer p_val) { + [] any timer.timeout { + p_val := ? + } + } + + testcase TC_Sem_050402_actual_parameters_226() runs on GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + a_test(); // tested parameter passing + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_226()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_227.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_227.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e1cade9711c3a83c82a17276a21155d7f62fa60 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050402_actual_parameters/Sem_050402_actual_parameters_227.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:5.4.2, verify that mixed notation can be used + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Actual parameters can be provided ... in a mixed notation where the first parameters are given in list notation +// and additional parameters in assignment notation. +// The test is based on modified example 11 + +module Sem_050402_actual_parameters_227 { + + type component GeneralComp { + } + + function f_mixed (out integer p_par1, in integer p_par2 := 2, inout integer p_par3) { + p_par1 := 1 + p_par2; + if (p_par2 == 2 and p_par3 == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_050402_actual_parameters_227() runs on GeneralComp { + var integer v := 0; + // the following statements all have the same semantics: + f_mixed(-,2,v); + f_mixed(-,p_par2 := 2, p_par3 := v); + f_mixed(-,-,p_par3 := v); + f_mixed(-,p_par3 := v, p_par2 := 2); + + setverdict(pass); + } + + control { + execute(TC_Sem_050402_actual_parameters_227()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSem_0504_parametrization_incompatibility_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSem_0504_parametrization_incompatibility_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e46ef668c5a6b6745ece696645ccd95a98afb3c9 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSem_0504_parametrization_incompatibility_001.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4, Ensure that the IUT correctly handles received testcase parametrization type incompatibility. + ** @verdict pass reject + ***************************************************/ +module NegSem_0504_parametrization_incompatibility_001 { + +type enumerated MyEnumeratedType {e_black, e_white} +type integer address; + +type record MyRecord { + integer field1, + boolean field2, + address field3, + MyEnumeratedType field4, + integer field5 +} + + +type component GeneralComp { + +} + + +testcase TC_NegSem_0504_parametrization_incompatibility_001 ( + MyRecord ExpectedMatch, + integer p_integer := 0, + boolean p_boolean := true, + address p_address := null, + MyEnumeratedType p_enumerated := e_black, + template integer p_integerTemplate := ? + ) runs on GeneralComp { + + // MyRecord cannot be built from the default p_integerTemplate parameter + var MyRecord ReceivedRecord := {p_integer, p_boolean, p_address, p_enumerated, p_integerTemplate}; + + if ( ReceivedRecord == ExpectedMatch ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + var MyRecord DefaultValues := { + field1 := 0, + field2 := true, + field3 := null, + field4 := e_black, + field5 := 1 //any number can be used here to correspond with ? matching + } + + execute(TC_NegSem_0504_parametrization_incompatibility_001(DefaultValues)); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d2b7c7e0b880a24c7113023f6f1b7ec65b6c760 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4, Ensure that the IUT rejects forbidden module parametrization types. + ** @verdict pass reject + ***************************************************/ +module NegSyn_0504_forbidden_parametrization_001 { + +modulepar { template integer INTEGER_MODULE_PARAMETER := 0 } + +type component GeneralComp { +} + + +testcase TC_NegSyn_0504_forbidden_parametrization_001() runs on GeneralComp { +} + +control{ + execute(TC_NegSyn_0504_forbidden_parametrization_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27f4cd3af83e1fd036f3deac72a2d7e172766711 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/0504_toplevel/NegSyn_0504_forbidden_parametrization_002.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.4, Ensure that the IUT rejects forbidden module parametrization types. + ** @verdict pass reject + ***************************************************/ +module NegSyn_0504_forbidden_parametrization_002 { + +modulepar { timer TIMER_MODULE_PARAMETER } + +type component GeneralComp { +} + + +testcase TC_NegSyn_0504_forbidden_parametrization_002() runs on GeneralComp { +} + +control{ + execute(TC_NegSyn_0504_forbidden_parametrization_002()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_001.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..440aaa4effab251d178824d1f929a284f719cca6 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:5.5, Verify that an error is detected when two constants reference each other + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Direct and indirect cyclic definitions are not allowed with the exception of the +// following cases: +// a) for recursive type definitions (see clause 6.2); +// b) function and altstep definitions (i.e. recursive function or altstep calls); +// c) cyclic import definitions, if the imported definitions only form allowed cyclic +// definitions. +// The test is a copy of example 1 from the chapter 5.5 +module NegSem_0505_cyclic_definitions_001 { + + type record ARecordType { integer a, integer b }; + const ARecordType c_test1 := { 1 , c_test2.b}; // c_test1 refers to c_test2 + const ARecordType c_test2 := { 1 , c_test1.b}; // c_test2 refers to c_test1 + +} diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_002.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74c55265a73b80d1a7f265785a4ed683f93651dc --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/NegSem_0505_cyclic_definitions_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.5, Verify that an error is detected when a forbidded cyclic reference occurs in cyclic import + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Direct and indirect cyclic definitions are not allowed with the exception of the +// following cases: +// a) for recursive type definitions (see clause 6.2); +// b) function and altstep definitions (i.e. recursive function or altstep calls); +// c) cyclic import definitions, if the imported definitions only form allowed cyclic +// definitions. +// The test is a modification of example 1 from the chapter 5.5 that defines both constants +// in different modules. + +module NegSem_0505_cyclic_definitions_002 { + import from NegSem_0505_cyclic_definitions_002_import { const c_test1 } + type record ARecordType { integer a, integer b }; + const ARecordType c_test2 := { 1 , c_test1.b}; // c_test2 refers to c_test1 + + testcase TC_Sem_0505_cyclic_definitions_005() runs on GeneralComp system GeneralComp { + log(c_test2); + } + + control{ + execute(TC_Sem_0505_cyclic_definitions_005()); + } +} + +module NegSem_0505_cyclic_definitions_002_import { + import from NegSem_0505_cyclic_definitions_002 all; + const ARecordType c_test1 := { 1 , c_test2.b}; // c_test1 refers to c_test2 +} diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_001.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d8aeeebaf439f617ac86712aeec187d8d2702f4 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_001.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.5, Ensure that the IUT correctly handles recursive functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0505_cyclic_definitions_001 { + +type component GeneralComp { +} + +function f_recursive(integer p_argument) return integer { + if(p_argument==0) { + return 1; + } + else { + return p_argument*f_recursive(p_argument-1); + } +} + +testcase TC_Sem_0505_cyclic_definitions_001() runs on GeneralComp { + if (f_recursive(10) == 3628800) { // checks 10! + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0505_cyclic_definitions_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_002.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32a03b633e6ba849e0f7013b70036b1f7a226395 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_002.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5.5, Ensure that the IUT correctly handles cyclic imports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_0505_cyclic_definitions_002 { + type integer MyInteger; + import from Sem_0505_cyclic_definitions_002_import { type MyIntegerList } + + +type component GeneralComp { +} + +testcase TC_Sem_0505_cyclic_definitions_002() runs on GeneralComp { + var MyIntegerList v_list := {1,2}; + + if ( match(v_list, { 1, 2})) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0505_cyclic_definitions_002()); +} + +} + +module Sem_0505_cyclic_definitions_002_import { + import from Sem_0505_cyclic_definitions_002 { type MyInteger } + type record of MyInteger MyIntegerList; +} diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_003.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b3247ec675cec0c7b6c76f5c1aa7d4eccdf802d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_003.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:5.5, Verify that cyclic import containing cyclic function calls is allowed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Direct and indirect cyclic definitions are not allowed with the exception of the +// following cases: +// a) for recursive type definitions (see clause 6.2); +// b) function and altstep definitions (i.e. recursive function or altstep calls); +// c) cyclic import definitions, if the imported definitions only form allowed cyclic +// definitions. +// In particular, the combination of c and b is tested + +module Sem_0505_cyclic_definitions_003 { + import from Sem_0505_cyclic_definitions_003_import { function f_factImp; } + type component GeneralComp { + } + + function f_fact(integer p_argument) return integer { + if(p_argument==0) { + return 1; + } + else { + return p_argument*f_factImp(p_argument-1); + } + } + + testcase TC_Sem_0505_cyclic_definitions_003() runs on GeneralComp { + if (f_fact(10) == 3628800) { // checks 10! + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_0505_cyclic_definitions_003()); + } + +} + +module Sem_0505_cyclic_definitions_003_import { + import from Sem_0505_cyclic_definitions_003 { function f_fact; } + function f_factImp(integer p_argument) return integer { + if(p_argument==0) { + return 1; + } + else { + return p_argument*f_fact(p_argument-1); + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_004.ttcn b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..311db3071e6bd6f908c62e4311e4684a253e61ca --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0505_cyclic_definitions/Sem_0505_cyclic_definitions_004.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:5.5, Verify that cyclic altsteps are allowed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Direct and indirect cyclic definitions are not allowed with the exception of the +// following cases: +// b) ... altstep definitions (i.e. recursive ... altstep calls); + +module Sem_0505_cyclic_definitions_004 { + type port P message { + inout integer; + } + type component GeneralComp { + var integer vc_receiveCounter := 0; + timer t_tmr := 1.0; + port P p1; + } + + altstep a_test() runs on GeneralComp { + [] p1.receive(integer:(0..3)) { + vc_receiveCounter := vc_receiveCounter + 1; + a_test(); + } + [] p1.receive(integer:?) { + if (vc_receiveCounter == 4) { + setverdict(pass); + } else { + setverdict(fail); + } + } + [] t_tmr.timeout { + setverdict(fail); + } + } + + testcase TC_Sem_0505_cyclic_definitions_004() runs on GeneralComp system GeneralComp { + connect(self:p1, self:p1); + for (var integer i := 0; i < 5; i := i + 1) { + p1.send(i); + } + t_tmr.start; + a_test(); + } + + control{ + execute(TC_Sem_0505_cyclic_definitions_004()); + } +} diff --git a/ATS/core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn b/ATS/core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1d5c1ece9bf16cb0d27c04c03b50a8cac828adb --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/05_toplevel/NegSyn_05_TopLevel_001.ttcn @@ -0,0 +1,12 @@ + +const integer wrongTopLevel := 1; + +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:5, Ensure that when the IUT loads a module containing some definitions before the module declaration then the module is rejected. + ** @verdict pass reject + *****************************************************************/ +module NegSyn_05_TopLevel_001 { + +} diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e78de7a8785b4a9527659f12733e5aedd8e63b9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_001.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign float to integer values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_001 { + const integer c_i1 := 0.0; // not an integer value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..750a5c00b969b0edddbf0ad370e08942207b16a2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_002.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign boolean to integer values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_002 { + const integer c_i1 := true; // not an integer value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea479f61c5c63b92725f02780b94bf57626931fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_003.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign integer to float values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_003 { + const float c_f1 := 0; // not a float value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd94fff7c95aff3bd555377f9c9ba80c2117a5f4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_004.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign boolean to float values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_004 { + const float c_f1 := true; // not a float value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76f86b2ffeb604113a4acffd97437698507fe7a2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_005.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign verdicttype to float values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_005 { + const float c_f1 := pass; // not a float value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e28c53cde0a8fb542612bb851f469903dc5439c8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/NegSyn_060100_SimpleBasicTypes_006.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign integer to verdicttype values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060100_SimpleBasicTypes_006 { + const verdicttype c_v1 := 1; // not a verdict +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7ef00c27199a4e80def486ecaac7a3325bf4361 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign and read integer values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060100_SimpleBasicTypes_001 { + + const integer c_i := 5; + + type component GeneralComp {} + + testcase TC_Sem_610_SimpleBasicTypes_001() runs on GeneralComp { + if (c_i == 5){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_610_SimpleBasicTypes_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..449807f8e60a07561472a50c559a563be42f76da --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign and read large integer values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060100_SimpleBasicTypes_002 { + + const integer c_i := 50000000000000; + + type component GeneralComp {} + + testcase TC_Sem_610_SimpleBasicTypes_002() runs on GeneralComp { + if (c_i == 50000000000000){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_610_SimpleBasicTypes_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82a11e9e70b1cd11c04befb8920d931861665147 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign and read float values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060100_SimpleBasicTypes_003 { + + const float c_f := 5.12E-5; + + type component GeneralComp {} + + testcase TC_Sem_610_SimpleBasicTypes_003() runs on GeneralComp { + if (c_f > 5E-5){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_610_SimpleBasicTypes_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c09d40ce328ddb572bf1b69175fe7cd84241c1b5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign and read large float values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060100_SimpleBasicTypes_004 { + + const float c_f := 5.23E200; + + type component GeneralComp {} + + testcase TC_Sem_610_SimpleBasicTypes_004() runs on GeneralComp { + if (c_f > 1E200){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_610_SimpleBasicTypes_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3323f5e38a5be7e3792a31ab239e30821e80b171 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Sem_060100_SimpleBasicTypes_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign and read verdicts + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060100_SimpleBasicTypes_005 { + + const verdicttype c_v := inconc; + + type component GeneralComp {} + + testcase TC_Sem_610_SimpleBasicTypes_005() runs on GeneralComp { + if (c_v == inconc){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_610_SimpleBasicTypes_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5b73c9d4ef70663162887116fe677b0384c6adc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_001.ttcn @@ -0,0 +1,11 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign different integer values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_001 { + const integer c_i1 := 0; + const integer c_i2 := 1; + const integer c_i3 := -5; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c194f0940e33a1eeee14605bd736d48adae2ef09 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_002.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign large integer values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_002 { + const integer c_i1 := 10000000000000; // large positive 10^13 + const integer c_i2 := -10000000000000; // large negative -10^13 +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3032b66e938558adfeb5c797cb03efae9f375bb1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_003.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign different float values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_003 { + const float c_f1 := 0.0; + const float c_f2 := 131E57; + const float c_f3 := 131E-57; + const float c_f4 := -502E55; + const float c_f5 := -502E-55; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2dae646fa1df77d55b38ad799fc9ecef57f49d3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_004.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Assign small and large float values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_004 { + const float c_f1 := 2E256; // large positive 2^256 + const float c_f2 := -2E256; // large negative -2^256 + const float c_f3 := 2E-256; // small positive 2^-256 + const float c_f4 := -2E-256; // small negative -2^256 +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a79fbf7d9c23148a05ca04d830a7796a664ed9c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_005.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Accept float mantisa for float values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_005 { + const float c_f1 := 2.0E2; + const float c_f2 := -2.1E-1; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2dc3fc2afa6256007bd71a9c3d1c7864d39f8939 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060100_simple_basic_types_and_values/Syn_060100_SimpleBasicTypes_006.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.0, Accept all verdict values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060100_SimpleBasicTypes_006 { + const verdicttype c_v1 := pass; + const verdicttype c_v2 := fail; + const verdicttype c_v4 := inconc; + const verdicttype c_v5 := none; + const verdicttype c_v6 := error; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..625c8a116c83bccbf73461c06f3e1d3049684ed2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access bitstring elements + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * Only single elements of the string may be accessed. + * Trying to assign strings with length 0 or more than 1 + * to a string element using the array-like syntax shall + * cause an error. +*/ + +module NegSem_06010101_AccessStringElements_001 { + + type component GeneralComp {} + + testcase TC_NegSem_06010101_AccessStringElements_001() runs on GeneralComp { + var octetstring v_b := '100010'O; + v_b[1] := '11'O; //error: only individual elements can be accessed + if (v_b == '100001'O){ + setverdict(pass); + } + else { + setverdict(fail, "v_b:",v_b); + } + } + + control{ + execute(TC_NegSem_06010101_AccessStringElements_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a32ec0b4bb11601710c90481c24fdc0c78f44ce6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSem_06010101_AccessStringElements_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access bitstring elements + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * The index shall be between zero and the + * length of the string minus one for retrieving + * an element from a string. Trying to retrieve outside + * this range shall cause an error. +*/ + +module NegSem_06010101_AccessStringElements_002 { + + type component GeneralComp {} + + testcase TC_NegSem_06010101_AccessStringElements_002() runs on GeneralComp { + var octetstring v_b := '100010'O; + v_b[6] := '01'O; //error: index outside of range + if (v_b == '100001'O){ + setverdict(pass); + } + else { + setverdict(fail, "v_b:",v_b); + } + } + + control{ + execute(TC_NegSem_06010101_AccessStringElements_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..597dde182a4228461c3c9ddf475d13f6d376c490 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access universal charstring elements + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * For assigning an element to the end of a string, the length of the string should be used as + * index. Trying to assign an element to the end of a string with an index larger than the + * length of the string shall cause an error. +*/ + +module NegSyn_06010101_AccessStringElements_001 { + + type component GeneralComp {} + + testcase TC_NegSyn_06010101_AccessStringElements_001() runs on GeneralComp { + var universal charstring v_b := "AbCdE"; + + v_b[1] := "FF"; // incorrect legth + } + + control{ + execute(TC_NegSyn_06010101_AccessStringElements_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ee45a044e1fd7469d71257605c54d27d36fe2c2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/NegSyn_06010101_AccessStringElements_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access bitstring elements + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * For initializing an uninitialized string with a single element, + * the index value zero (0) can be used as index. Trying to assign a + * single element to an uninitialized string with an index which is + * not zero (0) shall cause an error. +*/ + +module NegSyn_06010101_AccessStringElements_002 { + + type component GeneralComp {} + + testcase TC_NegSyn_06010101_AccessStringElements_002() runs on GeneralComp { + var universal charstring v_b := ""; + v_b[2] := "AB"; //error: incorrect index + } + + control{ + execute(TC_NegSyn_06010101_AccessStringElements_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82bb98398c75feeb5f702dc19a7250c1de2c0589 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access bitstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_001 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_001() runs on GeneralComp { + var bitstring v_b := '10001'B; + v_b[2] := '1'B; + if (v_b == '10101'B){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..441def075ad8eb6a2b7c635ffa126dab9bb3d1d7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access octetstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_002 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_002() runs on GeneralComp { + var octetstring v_b := '100010'O; + v_b[2] := '01'O; + if (v_b == '100001'O){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f893fc5748aa93a5d968e32d7f9dbf26aea22c8a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access hexstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_003 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_003() runs on GeneralComp { + var hexstring v_b := '10001'H; + v_b[2] := '1'H; + if (v_b == '10101'H){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7f25e81613202eebad39e89fe4d9d8a7aedb6ee --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_004.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access bitstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_004 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_004() runs on GeneralComp { + var bitstring v_b := ''B; + v_b[0] := '1'B; + v_b[1] := '0'B; + v_b[2] := '1'B; + v_b[3] := '0'B; + v_b[4] := '1'B; + if (v_b == '10101'B){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f88a85420a706d0e2013db8364d0c0d571dc1a14 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_005.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access hexstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_005 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_005() runs on GeneralComp { + var hexstring v_b := '00000'H; + v_b[0] := '1'H; + v_b[1] := '0'H; + v_b[2] := '1'H; + v_b[3] := '0'H; + v_b[4] := '1'H; + if (v_b == '10101'H){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fbaf41ef4e9527e818924a2822df90cbaafdaac --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_006.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access octetstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_006 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_006() runs on GeneralComp { + var octetstring v_b := ''O; + v_b[0] := '10'O; + v_b[1] := '01'O; + if (v_b == '1001'O){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebfefd4b1e56850f026d90ca19d33e6918544500 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_007.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access charstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_007 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_007() runs on GeneralComp { + var charstring v_b := "abc"; + v_b[2] := "d"; + if (v_b == "abd"){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f0f79386e693df0ccad06d486951c265c2025417 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_008.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access charstring elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_008 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_008() runs on GeneralComp { + var universal charstring v_b := char (0, 0, 40, 20); + v_b[0] := "d"; + if (v_b[0] == "d"){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..275174a38b820f76977c505bf55587fa31ef3611 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_009.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Access charstring elements with non printable characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_009 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_009() runs on GeneralComp { + var universal charstring v_b := char (0, 0, 1, 116); + + + if (v_b == "Ŵ" ){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_010.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..222877e6693341408d7d858d598d21fc347a73a1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/06010101_accessing_individual_string_elements/Sem_06010101_AccessStringElements_010.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1.1, Ensure that For initializing an uninitialized string with a single element, the index value zero (0) can be used as index. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010101_AccessStringElements_010 { + + type component GeneralComp {} + + testcase TC_Sem_06010101_AccessStringElements_010() runs on GeneralComp { + var universal charstring v_b :=""; + v_b[0] := "a"; + if (v_b == "a"){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010101_AccessStringElements_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12ecdefafdf3c2c0acd733f966756c1edaa6399c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_001.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign invalid bitstring value + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_001 { + const bitstring c_b1 := '2'B; // not an bitstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9a660fe1a77e5f04d7f88cff6e912e63f9f8120 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_002.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign string to bitstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_002 { + const bitstring c_b1 := "1"; // not an bitstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..727035fc906d8879bbd3f6e837cccac6dd9e4405 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_003.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign octetstring to bitstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_003 { + const bitstring c_b1 := '01'O; // not an bitstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83d4d380bf5038b960335259c20c017b5bff09fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_004.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign invalid hexstring value + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_004 { + const hexstring c_b1 := '01H'O; // not an hexstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..185f3b9f0a6c8097b7e86c7093934dcbc0d4715c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_005.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign string to hexstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_005 { + const hexstring c_b1 := "010"; // not an hexstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6430eb1fb6c52edc8ccb2df7eb76cfc8757a1e3d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_006.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign octetstring to hexstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_006 { + const hexstring c_b1 := '01'O; // not an hexstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55583ddef7716e7a4bf9b60a1a50bb2b0d5e4c4c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_007.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign invalid hexstring value + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_007 { + const octetstring c_b1 := '1FA'O; // not an octetstring value, odd number of nibbles +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2289256bcea171ff1a2f6fb8f63f8a1487543d50 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_008.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign string to octetstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_008 { + const octetstring c_b1 := "F15A"; // not an octetstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..11055d678bd172ed83353027287544597d191735 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_009.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign hexstring to octetstring values + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_009 { + const octetstring c_b1 := 'FA'H; // not an octetstring value +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_010.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c07aff4ee990209be63bd254502cd3cebccbbfd5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/NegSyn_060101_TopLevel_010.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign invalid hexstring value + ** @verdict pass reject + ***************************************************/ +module NegSyn_060101_TopLevel_010 { + const octetstring c_b1 := '1FAH'O; // not an octetstring value, H not valid +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c595f2f700109e57b05b08b1ab50db36d8afdb63 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read bitstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_001 { + + const bitstring c_b := '10001'B; + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_001() runs on GeneralComp { + if (c_b == '10001'B){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50ff0e7accdb54fb2bc57f6c6f49554e6a0489ef --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read hexstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_002 { + + const hexstring c_h := 'E1F0A'H; + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_002() runs on GeneralComp { + if (c_h == 'e1f0a'H){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16564c91c4e2cda60feabdf70749469ad11c8e89 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read octetstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_003 { + + const octetstring c_o := 'E1F30A'O; + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_003() runs on GeneralComp { + if (c_o == 'e1f30a'O){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cb5dee65cba9d4877834bcf1201f1d406860547 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_004 { + + const charstring c_s1 := "abcdef"; + const charstring c_s2 := "ab""cdef"; + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_004() runs on GeneralComp { + if (c_s1 == "abcdef"){ + setverdict(pass); + } + else { + setverdict(fail); + } + if (lengthof(c_s2) == 7){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08cfdc6ec5244738aae8f9425394cd56ebcd931e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read universal charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_005 { + + const universal charstring c_s1 := char (0, 0, 40, 48) & char ( 0, 0, 1, 113); + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_005() runs on GeneralComp { + if (lengthof(c_s1) == 2) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f0daa9ce4e0cbe4927df6b12e2068c69f6592b8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read universal charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060101_TopLevel_006 { + + const universal charstring c_s1 := "the Braille character " & char (0, 0, 40, 48) & "looks like this"; + + type component GeneralComp {} + + testcase TC_Sem_611_TopLevel_006() runs on GeneralComp { + if (lengthof(c_s1) > 10) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_611_TopLevel_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..069d553ce45281846357b538803a2c6f4bfd18c1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_007.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read universal charstring using USI like notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + The UCS sequence identifier-like (USI-like) notation using their short identifiers of code point. The USI-like notation is composed of the keyword char followed by parentheses. The +parentheses enclose a comma-separated list of short identifiers . Each short identifier represents a single +character and it shall be composed of a letter U or u followed by an optional "+" PLUS SIGN character, +followed by 1..8 hexadecimal digits. +*/ + +module Sem_060101_TopLevel_007 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_007() runs on GeneralComp { + var universal charstring v_a := char(U0041); //USI notation for character "A" + var universal charstring v_b := char(U0171); //USI notation for character "ű" + var universal charstring v_c := char(U41); //USI notation for character "A" without leading zeroes + var universal charstring v_d := char(U+171,U41); //USI notation for character "ű" and "A" without leading zeroes and + sign notation + + + + if (match(v_a,"A") and + match(v_b,"ű") and + match(v_c,"A") and + match(v_d,"űA")) + { + setverdict(pass,"v_a:",v_a, "v_b:",v_b, "v_c:",v_c,"v_d:",v_d); + } + else { + setverdict(fail,"v_a:",v_a, "v_b:",v_b, "v_c:",v_c,"v_d:",v_d); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b60931c132cb0638c80eb5b034698a792249224 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_008.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read bitstring with newline character + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_008 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_008() runs on GeneralComp { + var bitstring v_a := '0101\ + 1010'B; + + if (match(v_a,'01011010'B)) + { + setverdict(pass,"v_a:",v_a); + } + else { + setverdict(fail,"v_a:",v_a); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24df894bb9ef2463ce5fcf5cacb221c21fa08fa4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_009.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Ensure that whitespaces, control characters and backslash will be ignored for the bitstring length calculation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_009 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_009() runs on GeneralComp { + var bitstring v_a := '0101\ + 1010'B; + + if (match(lengthof(v_a), 8)) + { + setverdict(pass,"Size of v_a is:",lengthof(v_a)); + } + else { + setverdict(fail,"Size of v_a is:",lengthof(v_a)); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_010.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..555fc302bd001561eeb3d98c5cf9ebe5794e612a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_010.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read hexstring with newline character + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_010 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_010() runs on GeneralComp { + var hexstring v_a := 'Ab\ + cD'H; + + if (match(v_a,'AbcD'H)) + { + setverdict(pass,"v_a:",v_a); + } + else { + setverdict(fail,"v_a:",v_a); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_011.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7a9a3ffe7f02c21a796b754a21c8a5913309198 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_011.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Ensure that whitespaces, control characters and backslash will be ignored for the hexstring length calculation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_011 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_011() runs on GeneralComp { + var hexstring v_a := '12\ + 34\ + Ab\ + Cd'H; + + if (match(lengthof(v_a), 8)) + { + setverdict(pass,"Size of v_a is:",lengthof(v_a)); + } + else { + setverdict(fail,"Size of v_a is:",lengthof(v_a)); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_012.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38ed07800635aae41bc70a1f24ff3ddedd735d8f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_012.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign and read octetstring with newline character + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_012 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_012() runs on GeneralComp { + var octetstring v_a := '1234\ + 56'O; + + if (match(v_a,'123456'O)) + { + setverdict(pass,"v_a:",v_a); + } + else { + setverdict(fail,"v_a:",v_a); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_013.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b20d0f21876a25ae487795ce7edbac3eee143f7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_013.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Ensure that whitespaces, control characters and backslash will be ignored for the octetstring length calculation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Within the quotes any number of whitespaces or any sequence of the following C0 control characters: + * LF(10), VT(11), FF(12), CR(13) which constitutes a newline may be included. The newline shall be preceded by a backslash ("\"). + * Such whitespaces, control characters and backslash will be ignored for the value and length calculation. +*/ + +module Sem_060101_TopLevel_013 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_013() runs on GeneralComp { + var octetstring v_a := '12\ + 34\ + 56'O; // 3 octets + + if (match(lengthof(v_a), 3)) + { + setverdict(pass,"Size of v_a is: ",lengthof(v_a)); + } + else { + setverdict(fail,"Size of v_a is: ",lengthof(v_a)); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_014.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8bbef42e6f23b39a2d2eacdf9e580690b23db79 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_014.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Ensure that whitespaces and backslash character is allowed in a universal charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060101_TopLevel_014 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_014() runs on GeneralComp { + var universal charstring v_a := "ABC\ DEF"; + if (match(v_a,"ABC\ DEF")) + { + setverdict(pass,"v_a:",v_a); + } + else { + setverdict(fail,"v_a:",v_a); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_015.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c3111842b690452af9b7b3306df1d162b8a39c1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Sem_060101_TopLevel_015.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.1.1,Ensure that whitespaces, control characters and backslash will be included for the universal charstring length calculation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060101_TopLevel_015 { + + type component GeneralComp {} + + testcase TC_Sem_060101_TopLevel_015() runs on GeneralComp { + var universal charstring v_a := "ABC\ DEF"; //lengthof(v_a) is 11 + + if (match(lengthof(v_a), 11)) + { + setverdict(pass,"Size of v_a is:",lengthof(v_a)); + } + else { + setverdict(fail,"Size of v_a is:",lengthof(v_a)); + } + } + + control{ + execute(TC_Sem_060101_TopLevel_015()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d3f0b0735e7453b3ba889220d8317134e090961 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_001.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign different bitstring values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060101_TopLevel_001 { + const bitstring c_b1 := '0'B; + const bitstring c_b2 := '1'B; + const bitstring c_b3 := '01001'B; + const bitstring c_b4 := '000000000000000000000'B; + const bitstring c_b5 := '111111111111111111111'B; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e6961eea916adec686809fc1b949c002d98a513 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_002.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign different hexstring values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060101_TopLevel_002 { + const hexstring c_h1 := '0'H; + const hexstring c_h2 := '1FaB5'H; + const hexstring c_h3 := '07aDC4'H; + const hexstring c_h4 := '0000000000000000000000000'H; + const hexstring c_h5 := 'FFFFFFFFFFFFFFFFFFFFFFFFF'H; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a23da4394c4e9f180ee27681ffd3e888d445d2d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060101_basic_string_types_and_values/060101_toplevel/Syn_060101_TopLevel_003.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.1, Assign different octetstring values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060101_TopLevel_003 { + const octetstring c_o1 := '00'O; + const octetstring c_o2 := '1Fa3B5'O; + const octetstring c_o3 := '07aDC4'O; + const octetstring c_o4 := '000000000000000000000000'O; + const octetstring c_o5 := 'FFFFFFFFFFFFFFFFFFFFFFFF'O; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NOTES b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..b3f4afeb740834b3da18ee1811e607c996cd01a7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NOTES @@ -0,0 +1,2 @@ +- TODO: missing positive semantic tests for all types except bitstring +- TODO: missing negative tests for universal charstring \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6dfee92b38715951ac31e74ab8adb6d803c77922 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted bitstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_001 { + type bitstring MyListOfBitStrings ('01'B, '10'B, '11'B); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_001() runs on GeneralComp { + var MyListOfBitStrings v_b := '00'B; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..09ad4d0fd17584480118531ba25c1ebc4de95259 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_002.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted hexstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_002 { + type hexstring MyListOfHexStrings ('01'H, '10'H); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_002() runs on GeneralComp { + var MyListOfHexStrings v_h := '00'H; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..af74c98d0e8abd8f667ce28d7ef87c15581893a8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_003.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted octetstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_003 { + type octetstring MyListOfOctetStrings ('01'O, '10'O); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_003() runs on GeneralComp { + var MyListOfOctetStrings v_h := '00'O; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee6d7b6053d8d14610b8a00cd3ba387dfba0e6bb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_004.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_004 { + type charstring MyCharstr ("a", "abc"); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_004() runs on GeneralComp { + var MyCharstr v_b := "d"; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75dc329bf12695f162d0ea61fee18a14c37d080e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_005.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted integer. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_005 { + type integer MyInt (1, 5); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_005() runs on GeneralComp { + var MyInt v_i := 2; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7f7c393853b39dcaaa15c6d9217d7fe53c51401 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/NegSem_06010201_ListOfValues_006.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign values to restricted float. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010201_ListOfValues_006 { + type float MyFloat (1.0, 5.0); + + type component GeneralComp {} + + testcase TC_NegSem_06010201_ListOfValues_006() runs on GeneralComp { + var MyFloat v_f := 2.0; // value is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010201_ListOfValues_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/Sem_06010201_ListOfValues_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/Sem_06010201_ListOfValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58a5900c9d7e13f4d52bcfa5dfd2999b36c61d91 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010201_lists_of_values/Sem_06010201_ListOfValues_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.1, Assign invalid values to restricted bitstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010201_ListOfValues_001 { + type bitstring MyListOfBitStrings ('01'B, '10'B, '11'B); + + type component GeneralComp {} + + testcase TC_Sem_06010201_ListOfValues_001() runs on GeneralComp { + var MyListOfBitStrings v_b := '10'B; + if (v_b == '10'B){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_06010201_ListOfValues_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NOTES b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..fd2607366d46d0c5469be13627ebfc0372e581d0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NOTES @@ -0,0 +1 @@ +- TODO: missing positive and negative semantic tests for all types except bitstring diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38f3e525a330245a8dc9cfe53c6a6163cde305dd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted bitstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_001 { + type bitstring BitStrings1 ('0'B, '1'B ); + type bitstring BitStrings2 ('00'B, '01'B, '10'B, '10'B); + type bitstring BitStrings_1_2 (BitStrings1, BitStrings2); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_001() runs on GeneralComp { + var BitStrings_1_2 v_b := '11'B; // 11 is not defined by the type + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..262a955574a296390e7300bd79a437092c3ad16d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_002.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted hexstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_002 { + type hexstring HexStrings1 ('FE80'H, '01'H ); + type hexstring HexStrings2 ('00'H, '7F'H, 'B8'H, 'A0'H); + type hexstring HexStrings_1_2 (HexStrings1, HexStrings2); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_002() runs on GeneralComp { + var HexStrings_1_2 v_b; + v_b := 'FE70'H; //FE70 value is not defined by any hexstrings + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa0f9fe3380857b8a6d5ef3ea139194d7e2997f5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_003.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted octetstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_003 { + type octetstring Firstoctetstrings('0036'O,'0050'O); //30 and 40 in decimal + type octetstring Secondtoctetstrings ('0074'O,'0120'O); //50 and 60 in decimal + type octetstring octetStrings_1_2 (Firstoctetstrings, Secondtoctetstrings); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_003() runs on GeneralComp { + var octetStrings_1_2 v_b; + v_b := '0014'O; // '0014'O value is not defined + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8bf77b75c98b99072045c1d6db6426d4439f1d73 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_004.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_004 { + type charstring Firstcharstrings("abc", "def"); + type charstring Secondcharstrings("ghi", "jkl"); + type charstring charStrings_1_2 (Firstcharstrings,Secondcharstrings); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_004() runs on GeneralComp { + var charStrings_1_2 v_b; + v_b := "xyz"; // invalid charsting + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9bdd636613be3af4790295f088af708e403270ba --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_005.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted universal charstrings. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_005 { + type universal charstring unicharString1 ("0" .. "9","A".."Z"); // charstring between "0" and "9" and "A".."Z" + type universal charstring unicharString2 ("a".."z"); // charstring between "a" to "z" + type universal charstring unicharStrings_1_2 (unicharString1, unicharString2); + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_005() runs on GeneralComp { + var unicharStrings_1_2 v_b; + v_b:="?"; // invalid + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a85fd40396dba774c8aa06d31dbd1e6e51b12052 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_006.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted integers. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_006 { + type integer Integer1 (0..9 ); + type integer Integer2 (20..30); + type integer Integer_1_2 (Integer1, Integer2); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_006() runs on GeneralComp { + var Integer_1_2 v_b; + v_b := 15; //invalid + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22cb1049360b608660e2728e3da5f29b4108342b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_007.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted floats. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_007 { + type float Float1 (1.0E0..9E0); //float values between 1 and 9 + type float Float2 (2.0E1..3.0E1); //float values between 20 and 30 + type float Float_1_2 (Float1, Float2); + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_007() runs on GeneralComp { + var Float_1_2 v_b; + v_b := 15.5E0; //invalid + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..468d671129e1b95faafe72261f9c524c792f3be5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_008.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted boolean value. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_008 { + type boolean MyBoolean1 (false); //only "false" is accepted + + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_008() runs on GeneralComp { + var MyBoolean1 v_b; + v_b := true; // invalid + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010202_ListOfTypes_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f787ec7a8d4627bb7203d1f45d3f67a7ffd3f1db --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/NegSem_06010202_ListOfTypes_009.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign invalid values to list of types restricted verdicttype. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010202_ListOfTypes_009 { + type verdicttype Myverdict1 (pass, error); //only "pass" and "error" values are listed + type verdicttype Myverdict2 (inconc, none); //only "inconc" and "none" values are listed + type verdicttype Myverdict_1_2 (Myverdict1, Myverdict2); + + + type component GeneralComp {} + + testcase TC_NegSem_06010202_ListOfTypes_009() runs on GeneralComp { + var Myverdict_1_2 v_b; + v_b := fail; //invalid + setverdict(pass); + } + control{ + execute(TC_NegSem_06010202_ListOfTypes_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..420b63e26ad420233398dbb961d15f7f446163fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted bitstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_001 { + type bitstring BitStrings1 ('0'B, '1'B ); + type bitstring BitStrings2 ('00'B, '01'B, '10'B, '11'B); + type bitstring BitStrings_1_2 (BitStrings1, BitStrings2); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_001() runs on GeneralComp { + var BitStrings_1_2 v_b; + v_b := '10'B; + v_b := '1'B; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a385dd62fc3df956f213489ba03e83def60c49e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted hexstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_002 { + type hexstring HexStrings1 ('FE80'H, '01'H ); + type hexstring HexStrings2 ('00'H, '7F'H, 'B8'H, 'A0'H); + type hexstring HexStrings_1_2 (HexStrings1, HexStrings2); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_002() runs on GeneralComp { + var HexStrings_1_2 v_b; + v_b := 'FE80'H; //FE80 value is defined by the type HexStrings1 + v_b := '7F'H; //7F value is defined by the type HexStrings2 + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b604f8cee01b9bd6d0e127bfe162f9f72a2cbcf6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_003.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted octetstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_003 { + type octetstring Firstoctetstrings('0036'O,'0050'O); //30 and 40 in decimal + type octetstring Secondtoctetstrings ('0074'O,'0120'O); //50 and 60 in decimal + type octetstring octetStrings_1_2 (Firstoctetstrings, Secondtoctetstrings); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_003() runs on GeneralComp { + var octetStrings_1_2 v_b; + v_b := '0074'O; // '0074'O value is defined by the type Secondtoctetstrings + v_b := '0050'O; //'0050'O value is defined by the type Firstoctetstrings + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01dd06272fc3b560f8e501e13faba3e1f4d9f242 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_004.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted charstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_004 { + type charstring Firstcharstrings("abc", "def"); + type charstring Secondcharstrings("ghi", "jkl"); + type charstring charStrings_1_2 (Firstcharstrings,Secondcharstrings); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_004() runs on GeneralComp { + var charStrings_1_2 v_b; + v_b := "abc"; + v_b := "jkl"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43ca10f3d409a9de0c47fb85cb422302f2587635 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_005.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types unicharstring allows non-printable characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_005 { + type universal charstring unicharString1 ("0" .. "9","A".."Z"); // charstring between "0" and "9" and "A".."Z" + type universal charstring unicharString2 ("a".."z"); // charstring between "a" to "z" + type universal charstring unicharStrings_1_2 (unicharString1, unicharString2); + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_006() runs on GeneralComp { + var unicharStrings_1_2 v_b; + v_b :="5"; + v_b :="H"; + v_b:="j"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc9e06c02ac5c1316faead99bbbe2c52029042e4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_006.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted integers. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_006 { + type integer Integer1 (0..9 ); + type integer Integer2 (20..30); + type integer Integer_1_2 (Integer1, Integer2); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_006() runs on GeneralComp { + var Integer_1_2 v_b; + v_b := 5; + v_b := 25; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8bbbdaa434106bb39b59893cb5ce3bcaf8cc36ca --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_007.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted floats. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_007 { + type float Float1 (1.0E0..9E0); //float values between 1 and 9 + type float Float2 (2.0E1..3.0E1); //float values between 20 and 30 + type float Float_1_2 (Float1, Float2); + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_007() runs on GeneralComp { + var Float_1_2 v_b; + v_b := 5.5E0; //5.5 is between 1 and 9 + v_b := 2.55E1; //25.5 is between 20 and 30 + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4078ca08c095ffcc7f73332517850549867ec610 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_008.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted boolean value. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_008 { + type boolean MyBoolean1 (false,true); + + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_008() runs on GeneralComp { + var MyBoolean1 v_b; + v_b := false; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9403c5ea398377f30bda13a0ef9eb5101eb81ce --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010202_lists_of_types/Sem_06010202_ListOfTypes_009.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.2, Assign values to list of types restricted verdicttype. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010202_ListOfTypes_009 { + type verdicttype Myverdict1 (pass, error); //only "pass" and "error" values are listed + type verdicttype Myverdict2 (inconc, none); //only "inconc" and "none" values are listed + type verdicttype Myverdict_1_2 (Myverdict1, Myverdict2); + + + type component GeneralComp {} + + testcase TC_Sem_06010202_ListOfTypes_009() runs on GeneralComp { + var Myverdict_1_2 v_b; + v_b := pass; + v_b := none; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010202_ListOfTypes_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6d40ca50b69ba0c6c6732eaed9a1dd0035be7d1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to restricted integer. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_001 { + type integer MyIntegerRange (0 .. 255); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_001() runs on GeneralComp { + var MyIntegerRange v_i := -1; // -1 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98d43ecbb2cfeadf11d1c37a5af5aec15a210a55 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_002.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to restricted integer. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_002 { + type integer MyIntegerRange (-infinity .. 0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_002() runs on GeneralComp { + var MyIntegerRange v_i := 1; // 1 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fb70d7e793e4aaec32a1f76a7e2dc549819fefa --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_003.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assure that not_a_number is not allowed in float range subtyping. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_003 { + // causes an error as not_a_number is not allowed in range subtyping + type float MyFloatRange (-infinity .. not_a_number); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_003() runs on GeneralComp { + var MyFloatRange v_i; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39aa66e07382ea1566575b9e4db7a6173f29fa8c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_004.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to restricted integer with exclusive bounds. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_004 { + type integer MyIntegerRange (!-3 .. 0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_004() runs on GeneralComp { + var MyIntegerRange v_i := -3; // -3 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8402c28c9908d0af396cd0e642de733f834aa6d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_005.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to restricted integer with exclusive bounds. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_005 { + type integer MyIntegerRange (-infinity .. !0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_005() runs on GeneralComp { + var MyIntegerRange v_i := 0; // 0 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e724ebe6c34f497571e23441c90554fa14faec1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_006.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign range to boolean not permitted. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_006 { + // only restrictions for integer, float, charstring and universal charstring are allowed in ranges + type integer MyBooleanRange (false .. true); // should be rejected + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_006() runs on GeneralComp { + var MyBooleanRange v_b1; + v_b1 := true; + v_b1 := false; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37f30c8c7096af54ed9d486c7bbf95236088bc11 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_007.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_007 { + type charstring MyCharstringRange (!"a"..!"f"); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_007() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "a"; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..024926ad6601db171f1a480302aa15c95a355a01 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_008.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_008 { + type charstring MyCharstringRange ("a"..!"f"); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_008() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "f"; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_009.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be47857b630c7280aeea632b03832317b8e186a6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_009.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_009 { + type charstring MyCharstringRange ("a".."f"); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_009() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "g"; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_010.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf60859108ecc4faec943d9573debd7f2c98a070 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_010.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to restricted float. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_010 { + type float MyFloatRange (-infinity .. 0.0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_010() runs on GeneralComp { + var MyFloatRange v_f := 1.0; // 1.0 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_011.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c94b34019b0164d055a171df378ee2fc0993e34a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_011.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to range restricted float. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_011 { + type float MyFloatRange (-5.0 .. 0.0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_011() runs on GeneralComp { + var MyFloatRange v_f := 10.0; // 10.0 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_012.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..334aa111740d0a9322105e9dfe3810be7a191a16 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_012.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid values to range excluded restricted float. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_012 { + type float MyFloatRange (-1.0 .. !10.0); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_012() runs on GeneralComp { + var MyFloatRange v_f := 10.0; // 10.0 is outside range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_013.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4542b531804c239dc85dd349f96b13b61ce89a6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_013.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained universal charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_013 { + type universal charstring MyUCharString (char(0, 0, 1, 111) .. !char(0, 0, 1, 113)); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_013() runs on GeneralComp { + var MyUCharString v_uc1; + v_uc1 := char(0, 0, 1, 100); // out of range + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_014.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..888655ea2c1b428321e10e11a3a0eab06068492c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_014.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained universal charstring with mixed bounds. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_014 { + type universal charstring MyUCharString (char(0, 0, 1, 111) .. !char(0, 0, 1, 113)); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_014() runs on GeneralComp { + var MyUCharString v_uc1; + v_uc1 := char(0, 0, 1, 113); // 113 is excluded + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_015.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..adb34e669ef1ad5bb7a867a867fd06b3d9de4360 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_015.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign invalid value to range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_015 { + type charstring MyCharstringRange ("a".."f"); + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_015() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "abcgef"; // g not allowed + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_015()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_016.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c6a83755a6ea4599bd3493856d437c06e54ef37 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_016.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Invalid value infinity for range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_016 { + type charstring MyCharstringRange ("a"..infinity); // infinity not allowed for charstring + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_016() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "abcgef"; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_016()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_017.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da7735f2ed966e46a1684928e5b43baed3001cfb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/NegSem_06010203_Ranges_017.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Invalid value -infinity for range constrained charstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010203_Ranges_017 { + type charstring MyCharstringRange (-infinity.."d"); // -infinity not allowed for charstring + + type component GeneralComp {} + + testcase TC_NegSem_06010203_Ranges_017() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "abcgef"; + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010203_Ranges_017()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36ebe2365a313df2bfa76f14efc39ad948e8a630 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted integer. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_001 { + type integer MyIntegerRange (0 .. 255); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_001() runs on GeneralComp { + var MyIntegerRange v_i; + v_i := 0; + v_i := 100; + v_i := 255; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ee33a84999298536e162247bbc8b4e3764c4fd9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to infinity range restricted integer. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_002 { + type integer MyIntegerRange1 (-infinity .. 0); + type integer MyIntegerRange2 (0 .. infinity); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_002() runs on GeneralComp { + var MyIntegerRange1 v_i1; + var MyIntegerRange2 v_i2; + v_i1 := 0; + v_i1 := -100; + v_i1 := -200000; + v_i2 := 0; + v_i2 := 100; + v_i2 := 200000; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b86c46b95537debc761e39bc815352271051bc0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_003.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted integer with exclusive bounds. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_003 { + type integer MyIntegerRange1 (!0 .. 255); + type integer MyIntegerRange2 (0 .. !255); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_003() runs on GeneralComp { + var MyIntegerRange1 v_i1; + var MyIntegerRange2 v_i2; + v_i1 := 1; // 0 not allowed + v_i1 := 100; + v_i1 := 255; + v_i2 := 0; + v_i2 := 100; + v_i2 := 254; // 255 not allowed + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..933085af68b28f0c6e5449479a78c3d22f50c392 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_004.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted cahrstring with inclusive bounds. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_004 { + type charstring MyCharstringRange ("a".."f"); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_004() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "a"; + v_c1 := "c"; + v_c1 := "f"; + v_c1 := "acdef"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ae332c3e4c3759d5628f8b691a6027d36b4cf04 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_005.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted cahrstring with exclusive bounds. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_005 { + type charstring MyCharstringRange (!"a"..!"f"); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_005() runs on GeneralComp { + var MyCharstringRange v_c1; + v_c1 := "b"; + v_c1 := "c"; + v_c1 := "d"; + v_c1 := "e"; + v_c1 := "bcde"; + v_c1 := "bbeeebccdee"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a5deabfd2be48abff989714851587e86b413138 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted cahrstring with mixed bounds. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_006 { + type charstring MyCahrstringRange (!"a".."f"); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_006() runs on GeneralComp { + var MyCahrstringRange v_c1; + v_c1 := "b"; + v_c1 := "c"; + v_c1 := "d"; + v_c1 := "e"; + v_c1 := "f"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f0876e09f67e716d68fc0fd2d3071ba3af605b6b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_007.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted universal charstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_007 { + type universal charstring MyUCharString (char(0, 0, 1, 111) .. char(0, 0, 1, 113)); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_007() runs on GeneralComp { + var MyUCharString v_uc1; + v_uc1 := char(0, 0, 1, 111); + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..773281d8eb8a37ac54412666a3d2383e1525ce1f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010203_ranges/Sem_06010203_Ranges_008.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.1.2.3, Assign values to range restricted universal charstring with mixed bounds. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010203_Ranges_008 { + // Defines a string type of any length with each character within the range (111 or 112) + type universal charstring MyUCharString (char(0, 0, 1, 111) .. !char(0, 0, 1, 113)); + + type component GeneralComp {} + + testcase TC_Sem_06010203_Ranges_008() runs on GeneralComp { + var MyUCharString v_uc1; + v_uc1 := char(0, 0, 1, 111); + v_uc1 := char(0, 0, 1, 112); + v_uc1 := char(0, 0, 1, 112) & char(0, 0, 1, 112); + v_uc1 := char(0, 0, 1, 112) & char(0, 0, 1, 111) & char(0, 0, 1, 112); + setverdict(pass); + } + + control{ + execute(TC_Sem_06010203_Ranges_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NOTES b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..fd2607366d46d0c5469be13627ebfc0372e581d0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NOTES @@ -0,0 +1 @@ +- TODO: missing positive and negative semantic tests for all types except bitstring diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..826ad4a87b545676661a6961ffd3d7291170f6ac --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted bitstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_001 { + type bitstring BitStrings length(1 .. 2); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_001() runs on GeneralComp { + var BitStrings v_b := '111'B; // value length 3 != type length is 1 or 2 + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8768daf0542de5033571bbae56fef834d981890 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_002.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted bitstring. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_002 { + type bitstring BitStrings length(2); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_002() runs on GeneralComp { + var BitStrings v_b := '111'B; // value length 3 != type length is 2 + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a0cf43d43c2a75d7778366d229ae261ba6e1308e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_003.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted hexstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_003 { + type hexstring HexStrings1 length(3); //3 hexadecimal digits + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_003() runs on GeneralComp { + var HexStrings1 v_b1; + v_b1 := 'FE00'H; //invalid length 4 + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e376f205f8424582dd5e4c741133b2204f08eeca --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_004.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted hexstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_004 { + type hexstring HexStrings1 length(2 .. infinity); //hexadecimal digits between 2 and 5 + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_004() runs on GeneralComp { + var HexStrings1 v_b1; + v_b1 := 'A'H; //invalid length 1 + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5a471a9bdf5ab65cc73079456945d4084886981 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_005.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted octetstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_005 { + type octetstring ocStrings1 length(4); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_005() runs on GeneralComp { + var ocStrings1 v_b1; + v_b1 := 'FE8001'O; //3 octets invalid length + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7d8a1e657fb9e735652063819b0b862101b8d39 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_006.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted octetstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_006 { + type octetstring ocStrings1 length(2..infinity); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_006() runs on GeneralComp { + var ocStrings1 v_b1; + v_b1 := 'FE'O; //1 octet invalid length + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..239fc088c6476d45b988a89b5fc322ad25db561c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_007.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted charstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_007{ + type charstring myStrings1 length(2..infinity); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_007() runs on GeneralComp { + var myStrings1 v_b1; + v_b1 := "a"; //1 charc. length + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_008.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d15d1adff87eead8e358d2d528749e266aa0bb2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSem_06010204_StringLenghtRestrict_008.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign invalid values to length restricted charstring + ** @verdict pass reject + ***************************************************/ +module NegSem_06010204_StringLenghtRestrict_008{ + type charstring myStrings1 length(2); + + type component GeneralComp {} + + testcase TC_NegSem_06010204_StringLenghtRestrict_008() runs on GeneralComp { + var myStrings1 v_b1; + v_b1 := "abc"; //2 characters length req. + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010204_StringLenghtRestrict_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2233de1499cc991828f3275e20f27d62cf6879d5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_001.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, upper boundary should be greater than lower boundary in string lenght restictions + ** @verdict pass reject + ***************************************************/ +module NegSyn_06010204_StringLenghtRestrict_001 { + type hexstring HexStrings1 length(3 .. 1); // upper bounder is smaller than lower bound + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..411b78a9a4f37b08f91b03c18f99bd40c9ad5f24 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/NegSyn_06010204_StringLenghtRestrict_002.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, boundary integers should be non negative integers + ** @verdict pass reject + ***************************************************/ +module NegSyn_06010204_StringLenghtRestrict_001 { + type hexstring HexStrings1 length(0 .. -5); // negative boundary for length + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4011e6405d82ae32328c3f66064c8ca115508581 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign values to list of types restricted bitstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010204_StringLenghtRestrict_001 { + type bitstring BitStrings1 length(1 .. 2); + type bitstring BitStrings2 length(5); + type bitstring BitStrings3 length(0 .. infinity); + + type component GeneralComp {} + + testcase TC_Sem_06010204_StringLenghtRestrict_001() runs on GeneralComp { + var BitStrings1 v_b1; + var BitStrings2 v_b2; + var BitStrings3 v_b3; + v_b1 := '10'B; + v_b1 := '1'B; + v_b2 := '10000'B; + v_b3 := '111111'B; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010204_StringLenghtRestrict_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aad50de03a4678410643412c0de3b3bb4f30065f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign values to list of types restricted hexstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010204_StringLenghtRestrict_002 { + type hexstring HexStrings1 length(1 .. 2); + type hexstring HexStrings2 length(4); + type hexstring HexStrings3 length(0 .. infinity); + + type component GeneralComp {} + + testcase TC_Sem_06010204_StringLenghtRestrict_002() runs on GeneralComp { + var HexStrings1 v_b1; + var HexStrings2 v_b2; + var HexStrings3 v_b3; + v_b1 := 'F'H; + v_b1 := 'FE'H; + v_b2 := 'FE80'H; + v_b3 := 'FFFFFFFFFF'H; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010204_StringLenghtRestrict_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f207bfe55f3e574bc21e800ab70e3689322fbf59 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_003.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign values to list of types restricted octetstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010204_StringLenghtRestrict_003 { + type octetstring ocStrings1 length(2 .. 4); + type octetstring ocStrings2 length(4); + type octetstring ocStrings3 length(0 .. infinity); + + type component GeneralComp {} + + testcase TC_Sem_06010204_StringLenghtRestrict_003() runs on GeneralComp { + var ocStrings1 v_b1; + var ocStrings2 v_b2; + var ocStrings3 v_b3; + v_b1 := 'FE80'O; //2 octets + v_b1 := 'FE8001'O; //3 octets + v_b2 := 'FE800201'O; //4 octets + v_b3 := 'FE830043'O; //4 octets + setverdict(pass); + } + + control{ + execute(TC_Sem_06010204_StringLenghtRestrict_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ba42a8e1e02375ae2e9e4b3ccd85a5390dc464a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010204_string_length_restrictions/Sem_06010204_StringLenghtRestrict_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.1.2.4, Assign values to list of types restricted charstring. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010204_StringLenghtRestrict_004 { + type charstring myStrings1 length(2 .. 4); //length between 2 and 4 characters + type charstring myStrings2 length(4); //fixed length 4 characters + type charstring myStrings3 length(0 .. infinity); //unlimited character length + + type component GeneralComp {} + + testcase TC_Sem_06010204_StringLenghtRestrict_004() runs on GeneralComp { + var myStrings1 v_b1; + var myStrings2 v_b2; + var myStrings3 v_b3; + v_b1 := "ab"; //2 characters + v_b1 := "abc"; //3 characters + v_b2 := "efgh"; //fixed 4 characters + v_b3 := "abcdefghijklm"; //unlimited + setverdict(pass); + } + + control{ + execute(TC_Sem_06010204_StringLenghtRestrict_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NOTES b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..ffe1dc1dd1b1a881633977867117e51db5740b8b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NOTES @@ -0,0 +1 @@ +- TODO: missing positive and negative semantic tests for universal charstring diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSem_06010205_StringPattern_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSem_06010205_StringPattern_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa3efbce41d2a8bb80c468af316cf235b6119e65 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSem_06010205_StringPattern_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign invalid values to pattern restricted character strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_06010205_StringPattern_001 { + type charstring MyString (pattern "?bc*xyz"); + + type component GeneralComp {} + + testcase TC_NegSem_06010205_StringPattern_001() runs on GeneralComp { + var MyString v_c := "abcyz"; // value missing x + setverdict(pass); + } + + control{ + execute(TC_NegSem_06010205_StringPattern_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..366e052344b808c1702b22b2e480ab5417e673da --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_001.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign values to pattern restricted character strings without @nocase modifier. + ** @verdict pass reject, noexecution + ***************************************************/ + +module NegSyn_06010205_StringPattern_001 { + type charstring MyString (pattern "abc*xyz"); //without @nocase + + type component GeneralComp {} + + testcase TC_NegSyn_06010205_StringPattern_001() runs on GeneralComp { + var MyString v_c; + v_c := "ABc1234xYz"; //error value is out of constraint: ABc + } + + control{ + execute(TC_NegSyn_06010205_StringPattern_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00f35bad2e8244a83c874b950b471441c1bb16cd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/NegSyn_06010205_StringPattern_002.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign quadruple values to pattern restricted character strings. + ** @verdict pass reject, noexecution + ***************************************************/ + +module NegSyn_06010205_StringPattern_002 { + type charstring MyString (pattern "\q{0,0,1,116}abc"); //error: not a legal character for the TTCN 3 charstring type + + + type component GeneralComp {} + + testcase TC_NegSyn_06010205_StringPattern_002() runs on GeneralComp { + var MyString v_c := "Ŵabc"; //error: not a legal character of the TTCN 3 charstring type + } + + control{ + execute(TC_NegSyn_06010205_StringPattern_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a92f666b5f0a64f8ace8199516f9479abbe27ae --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign values to pattern restricted character strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010205_StringPattern_001 { + type charstring MyString (pattern "abc*xyz"); + + type component GeneralComp {} + + testcase TC_Sem_06010205_StringPattern_001() runs on GeneralComp { + var MyString v_c; + v_c := "abcxyz"; + v_c := "abc123xyz"; + v_c := "abc:xyz"; + v_c := "abc...xyz"; + v_c := "abc*xyz"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010205_StringPattern_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5b7544801ec1704baa206d4b59df338e24cb9ef --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign values to pattern restricted character strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06010205_StringPattern_002 { + type charstring MyString (pattern "abc?xyz"); + + type component GeneralComp {} + + testcase TC_Sem_06010205_StringPattern_002() runs on GeneralComp { + var MyString v_c; + v_c := "abc1xyz"; + v_c := "abc:xyz"; + v_c := "abc.xyz"; + v_c := "abc*xyz"; + v_c := "abc?xyz"; + setverdict(pass); + } + + control{ + execute(TC_Sem_06010205_StringPattern_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8248ebc130cce088f4e9f7e496fa5d87d367f82 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010205_pattern_subtyping_of_character_string_types/Sem_06010205_StringPattern_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.1.2.5, Assign values to pattern restricted character strings with @nocase modifier. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: +When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way. +*/ + +module Sem_06010205_StringPattern_003 { + type charstring MyString (pattern @nocase "abc*xyz"); // with @nocase modifier now characters from "A...Z" is also allowed + + type component GeneralComp {} + + testcase TC_Sem_06010205_StringPattern_003() runs on GeneralComp { + + var MyString v_c; + + //valid: + v_c := "ABc1234xyz"; + v_c := "aBC:xYz"; + v_c := "AbC.xyZ"; + v_c := "ABc*xYZ"; + v_c := "ABC?XYZ"; + setverdict(pass,"The resuls is: ",v_c); + } + + control{ + execute(TC_Sem_06010205_StringPattern_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f1ee209e0cff7fbdf4b8b3016018aafb6f4bdbf --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.1, Assign invalid values to mixed restricted floats. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020601_MixingSubtype_001 { + type float lessThanPiAndNaN (-infinity .. 3142E-3, not_a_number); + + type component GeneralComp {} + + testcase TC_NegSem_0601020601_MixingSubtype_001() runs on GeneralComp { + var lessThanPiAndNaN v_f := 4.0; // value out of range + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020601_MixingSubtype_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd7c9075ba35ae5a7d54253676b78cfc7ded86e6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/NegSem_0601020601_MixingSubtype_002.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.1, Assign invalid values to mixed restricted integers. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020601_MixingSubtype_002 { + type integer MyInt (1, 5, 10, 100 .. infinity); + + type component GeneralComp {} + + testcase TC_NegSem_0601020601_MixingSubtype_002() runs on GeneralComp { + var MyInt v_i := 6; // value out of range + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020601_MixingSubtype_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..101059850f094bb1633f074ff6adf294f4ec0ba9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.1, Assign values to mixed restricted floats. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020601_MixingSubtype_001 { + type float lessThanPiAndNaN (-infinity .. 3142E-3, not_a_number); + + type component GeneralComp {} + + testcase TC_Sem_0601020601_MixingSubtype_001() runs on GeneralComp { + var lessThanPiAndNaN v_f; + v_f := 3.14E0; + v_f := 0.0; + v_f := -4E40; + v_f := not_a_number; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020601_MixingSubtype_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..214e7163a877c43a8453af4fe18eb3f305d63542 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020601_mixing_patterns_lists_and_ranges/Sem_0601020601_MixingSubtype_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.1, Assign values to mixed restricted integers. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020601_MixingSubtype_002 { + type integer MyInt (1, 5, 10, 100 .. infinity); + + type component GeneralComp {} + + testcase TC_Sem_0601020601_MixingSubtype_002() runs on GeneralComp { + var MyInt v_i; + v_i := 1; + v_i := 5; + v_i := 10; + v_i := 100; + v_i := 1000; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020601_MixingSubtype_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NOTES b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..ffe1dc1dd1b1a881633977867117e51db5740b8b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NOTES @@ -0,0 +1 @@ +- TODO: missing positive and negative semantic tests for universal charstring diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cefc5e7bb41a6a142969d872574c741d5ab37987 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted character strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_001 { + type charstring MyString (pattern "?bc*xyz") length (5 .. 8); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_001() runs on GeneralComp { + var MyString v_c := "abcyz"; // value missing x + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..811d0a206f8d5e6d30c2bd0e906f2dd14c85d019 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_002.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted character strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_002 { + type charstring MyString (pattern "?bc*xyz") length (5 .. 8); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_002() runs on GeneralComp { + var MyString v_c := "abc123xyz"; // value length 9 exceeds 8 + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2219daf1838b9683ce8d3b75e815c0cd6eb1d20f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_003.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted character strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_003 { + type charstring MyString ("a".."z") length (3 .. 8); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_003() runs on GeneralComp { + var MyString v_c := "abc1xyz"; // char 1 not allowed + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f160cd51962b692d8c316263ff81b16869f8590e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_004.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted bit strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_004 { + type bitstring MyString ('111'B, '101010'B, '111111'B) length (4 .. 8); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_004() runs on GeneralComp { + var MyString v_c := '111'B; // value lenght 3 not allowed + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4a17d49640ee07086a4ace44bca528765a630ce --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_005.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted hex strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_005 { + type hexstring MyString ('1F1'H, '103A10'H, '111111'H) length (4 .. 8); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_005() runs on GeneralComp { + var MyString v_c := '1F1'H; // value lenght 3 not allowed + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9401835982ad2066a8a7d36c947fdb512a4ad4f4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/NegSem_0601020602_StringMixing_006.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign invalid values to mixed restricted octet strings. + ** @verdict pass reject + ***************************************************/ +module NegSem_0601020602_StringMixing_006 { + type octetstring MyString ('FF1111'O, '101010A3'O, 'FFFFFFFFFF'O) length (4); + + type component GeneralComp {} + + testcase TC_NegSem_0601020602_StringMixing_006() runs on GeneralComp { + var MyString v_c := 'FF1111'O; // value lenght 3 not allowed + setverdict(pass); + } + + control{ + execute(TC_NegSem_0601020602_StringMixing_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_001.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4406ba269b61bd471f11c62c4ef7bbf22568a8e9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted character strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_001 { + type charstring MyString (pattern "abc*xyz") length (5 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_001() runs on GeneralComp { + var MyString v_c; + v_c := "abcxyz"; + v_c := "abc12xyz"; + v_c := "abc:xyz"; + v_c := "abc..xyz"; + v_c := "abc*xyz"; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_002.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f6063216575fa63ab2c3f619a7709ffd5d15172 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted character strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_002 { + type charstring MyString ("a".."z") length (3 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_002() runs on GeneralComp { + var template MyString v_c; + v_c := "abc"; + v_c := "abcdefgh"; + v_c := pattern "abc?def"; + v_c := pattern "abc*xyz"; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_003.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..436306e5b418ee09a343963781111b1696157b92 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_003.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted character strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_003 { + type charstring MyString ("abcdef", "abc", "123abc") length (3 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_003() runs on GeneralComp { + var MyString v_c; + v_c := "123abc"; + v_c := "abc"; + v_c := "abcdef"; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_004.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..304b5e65e355538aabbaa89a7a120aceb88f1609 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_004.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted bit strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_004 { + type bitstring MyString ('111'B, '101010'B, '111111'B) length (3 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_004() runs on GeneralComp { + var MyString v_c; + v_c := '111'B; + v_c := '101010'B; + v_c := '111111'B; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_005.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf52b32537aed9e1fe1a9494e91faa843f9694fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_005.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted hex strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_005 { + type hexstring MyString ('1F1'H, '103A10'H, '111111'H) length (3 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_005() runs on GeneralComp { + var MyString v_c; + v_c := '1F1'H; + v_c := '103A10'H; + v_c := '111111'H; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_006.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ffaa97aef730d37722bb2b9711dbabd98973d957 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_006.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to mixed restricted octet strings. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0601020602_StringMixing_006 { + type octetstring MyString ('FF1111'O, '101010A3'O, 'FFFFFFFFFF'O) length (3 .. 8); + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_006() runs on GeneralComp { + var MyString v_c; + v_c := 'FF1111'O; + v_c := '101010A3'O; + v_c := 'FFFFFFFFFF'O; + setverdict(pass); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dddd774127b337ada453c74ab089863a97e810ea --- /dev/null +++ b/ATS/core_language/06_types_and_values/0601_basic_types_and_values/060102_subtyping_of_basic_types/06010206_mixing_subtyping_mechanisms/0601020602_using_length_restriction_with_other_constraints/Sem_0601020602_StringMixing_007.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.1.2.6.2, Assign values to pattern restricted character strings using @nocase modifier + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: +When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way +*/ + +module Sem_0601020602_StringMixing_007 { + type charstring unicharString (pattern "[a-z]#(1,5)") length (1..5); // charstring between "a".."z" and length from 1 to 5 + type charstring unicharString_nocase (pattern @nocase "[a-z]#(1,5)") length (1..5); // with @nocase modifier now characters from "A...Z" is also allowed + + type component GeneralComp {} + + testcase TC_Sem_0601020602_StringMixing_007() runs on GeneralComp { + var unicharString v_a; //without @nocase modifier + var unicharString_nocase v_b; //with @nocase modifier + v_a :="abxyz"; + v_b :=v_a; //v_b :="abxyz"; + v_b :="AbXyZ"; + + setverdict(pass,"The result is: ",v_b); + } + + control{ + execute(TC_Sem_0601020602_StringMixing_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8fa984266553eadcf7409977f832d38b676a560e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_06020101_ReferencingRecordFields_001 { + +type component GeneralComp { +} + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + type R ConstrainedRecord ({1, omit}, {2, "xyz"}, {3, "zyx"}) ; + + type ConstrainedRecord.field1 MyInteger; + +testcase TC_NegSem_06020101_ReferencingRecordFields_001() runs on GeneralComp { + + var MyInteger v_int := 11; // assignment from outside of the carried over (1 .. 10) range constraint + +} + +control { + execute(TC_NegSem_06020101_ReferencingRecordFields_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..242e85dbe267a31e9c554ce0a6284f1196419fd2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that record fields cannot reference themselves + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Fields of record type definitions shall not reference themselves. + +module NegSem_06020101_ReferencingRecordFields_002 { + + type component GeneralComp { + } + + type record R { + integer field1, + R.field2 field2 optional, // this circular reference is NOT ALLOWED + boolean field3 + } + + testcase TC_NegSem_06020101_ReferencingRecordFields_002() runs on GeneralComp { + var R v_rec := { field1 := 1, field2 := omit, field3 := true }; + if (v_rec.field1 == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_06020101_ReferencingRecordFields_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7cc7764ff098eeeb8930fdc10fb5734e3ba2af5a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_003.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that referencing uninitialized record on the right hand of an assignment is not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Referencing a subfield of an uninitialized or omitted record field or value on the right +// hand side of an assignment shall cause an error. + +module NegSem_06020101_ReferencingRecordFields_003 { + + type component GeneralComp { + } + + type record R { + record { + integer subfield1 + } field1, + charstring field2 optional + } + + testcase TC_NegSem_06020101_ReferencingRecordFields_003() runs on GeneralComp { + var R v_rec; + v_rec.field2 := "abc"; + if (v_rec.field1.subfield1 == 5) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_NegSem_06020101_ReferencingRecordFields_003()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae6ebc2ed612bbf1a0a14d3cf48feb0a20225f8f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/NegSem_06020101_ReferencingRecordFields_004.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that referencing omitted record on the right hand of an assignment is not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Referencing a subfield of an uninitialized or omitted record field or value on the right +// hand side of an assignment shall cause an error. + +module NegSem_06020101_ReferencingRecordFields_004 { + + type component GeneralComp { + } + + type record R { + record { + integer subfield1 + } field1 optional, + charstring field2 optional + } + + testcase TC_NegSem_06020101_ReferencingRecordFields_004() runs on GeneralComp { + var R v_rec; + v_rec.field1 := omit; + v_rec.field2 := "abc"; + if (v_rec.field1.subfield1 == 5) { + setverdict(fail); + } else { + setverdict(pass); + } + } + + control { + execute(TC_NegSem_06020101_ReferencingRecordFields_004()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35996f4d3fa1e346194bdce61c8532602c3f2d86 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06020101_ReferencingRecordFields_001 { + +type component GeneralComp { +} + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + type R ConstrainedRecord ({1, omit}, {2, "xyz"}, {3, "zyx"}) ; + + type ConstrainedRecord.field1 MyInteger; + +testcase TC_Sem_06020101_ReferencingRecordFields_001() runs on GeneralComp { + + var MyInteger v_int := 9; // v_int is allowed in (1 .. 10) range + + if (v_int==9) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06020101_ReferencingRecordFields_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3bf4a2fd4ccd85993ca3a8b4c87246b90ef7586 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06020101_ReferencingRecordFields_002 { + +type component GeneralComp { +} + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + type R ConstrainedRecord ({1, omit}, {2, "xyz"}, {3, "zyx"}) ; + + type ConstrainedRecord.field2 MyChar; + +testcase TC_Sem_06020101_ReferencingRecordFields_002() runs on GeneralComp { + + var MyChar v_char := "abc"; // any character string is allowed + + if (v_char=="abc") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06020101_ReferencingRecordFields_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0daad7b369d8a6eca090358e8ed3ced97e12ba8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06020101_ReferencingRecordFields_003 { + +type component GeneralComp { +} + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + type R.field1 MyInteger; + +testcase TC_Sem_06020101_ReferencingRecordFields_003() runs on GeneralComp { + + var MyInteger v_int := 9; // v_int is allowed in (1 .. 10) range + + if (v_int==9) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06020101_ReferencingRecordFields_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b3d1827d264f73a83749aa7a37bc5a48f16bf9e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, The dot notation used in record type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06020101_ReferencingRecordFields_004 { + +type component GeneralComp { +} + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + + type R.field2 MyChar; + +testcase TC_Sem_06020101_ReferencingRecordFields_004() runs on GeneralComp { + + var MyChar v_char := "abc"; // any character string is allowed + + if (v_char=="abc") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06020101_ReferencingRecordFields_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ea06b3f7c510b3a9b7dce8f49ce39e5be5c9de4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that dot notation can be used for referencing elements on the right hand side of an assignement + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId, +// where TypeIdOrExpression resolves to the name of a structured type or an expression of +// a structured type such as variable, formal parameter, module parameter, constant, template, +// or function invocation. ElementId shall resolve to the name of a field in the structured +// type. + +module Sem_06020101_ReferencingRecordFields_005 { + + type component GeneralComp { + } + + type record R { + integer field1 (1 .. 10), + charstring field2 optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_005() runs on GeneralComp { + var R v_rec := { field1 := 5, field2 := "abc" }; + if (v_rec.field1 == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..744b3e9bac50ddfefd6e66c8ead5226eb4fca872 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_006.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that dot notation can be used for referencing sub-elements on the right hand side of an assignement + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId, +// where TypeIdOrExpression resolves to the name of a structured type or an expression of +// a structured type such as variable, formal parameter, module parameter, constant, template, +// or function invocation. ElementId shall resolve to the name of a field in the structured +// type. + +module Sem_06020101_ReferencingRecordFields_006 { + + type component GeneralComp { + } + + type record R { + record { + integer subfield1 + } field1, + charstring field2 optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_006() runs on GeneralComp { + var R v_rec := { field1 := { subfield1 := 5 }, field2 := "abc" }; + if (v_rec.field1.subfield1 == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_006()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..757116b75b7f94834735cdd54eeb011afbd77f93 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_007.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that dot notation can be used for referencing function invocation results + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId, +// where TypeIdOrExpression resolves to the name of a structured type or an expression of +// a structured type such as variable, formal parameter, module parameter, constant, template, +// or function invocation. ElementId shall resolve to the name of a field in the structured +// type. + +module Sem_06020101_ReferencingRecordFields_007 { + + type component GeneralComp { + } + + type record R { + record { + integer subfield1 + } field1, + charstring field2 optional + } + + function f_retVal() return R { + return { field1 := { subfield1 := 5 }, field2 := "abc" }; + } + + testcase TC_Sem_06020101_ReferencingRecordFields_007() runs on GeneralComp { + if (f_retVal().field1.subfield1 == 5) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_007()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f58d4486f6e48e9685008cf26850e8d19db623a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_008.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that mandatory fields are created and uninitialized when expanding uninitialized record values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_008 { + + type component GeneralComp { + } + + type record R { + integer field1, + charstring field2 + } + + testcase TC_Sem_06020101_ReferencingRecordFields_008() runs on GeneralComp { + var R v_rec; + v_rec.field2 := "abc"; + if (isbound(v_rec) and not isbound(v_rec.field1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_008()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..919956767042d026df9f4e88b237d2aed29b1777 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_009.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that optional fields are created and uninitialized when expanding uninitialized record values (explicit omit) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_009 { + + type component GeneralComp { + } + + type record R { + integer field1 optional, + charstring field2 + } + + testcase TC_Sem_06020101_ReferencingRecordFields_009() runs on GeneralComp { + var R v_rec; + v_rec.field2 := "abc"; + if (isbound(v_rec) and not isbound(v_rec.field1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_009()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..930907bc15e03426b5e5a57d061518401481a28d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_010.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that optional fields are created and omitted when expanding uninitialized record values (implicit omit) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_010 { + + type component GeneralComp { + } + + type record R { + integer field1 optional, + charstring field2 + } + + testcase TC_Sem_06020101_ReferencingRecordFields_010() runs on GeneralComp { + var R v_rec; + v_rec.field2 := "abc"; + if (v_rec == { omit, "abc" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_010()); + } +} with { optional "implicit omit" } diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3116581abbd06c99f03ee1add0a597468446791a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_011.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that referencing fields nested deep inside uninitialized record invokes expansion + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_011 { + + type component GeneralComp { + } + + type record R { + record { + record { + integer nested1, + integer nested2 + } subfield1, + integer subfield2 + } field1, + charstring field2 + } + + testcase TC_Sem_06020101_ReferencingRecordFields_011() runs on GeneralComp { + var R v_rec; + v_rec.field1.subfield1.nested1 := 0; + if (isbound(v_rec) and isbound(v_rec.field1) and not isbound(v_rec.field2) and + isbound(v_rec.field1.subfield1) and not isbound(v_rec.field1.subfield2) and + v_rec.field1.subfield1.nested1 == 0 and not isbound(v_rec.field1.subfield1.nested2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_011()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17e46fb922cf424fe91d2235c7301c59f6dabad7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_012.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that expansion of uninitialized record values works when other constructive types are involved + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_012 { + + type component GeneralComp { + } + + type record R { + union { + record { + integer nested1, + integer nested2 + } option1[2], + integer option2 + } field1, + charstring field2 + } + + testcase TC_Sem_06020101_ReferencingRecordFields_012() runs on GeneralComp { + var R v_rec; + v_rec.field1.option1[0].nested1 := 0; + if (isbound(v_rec) and isbound(v_rec.field1) and not isbound(v_rec.field2) and + match(v_rec.field1.option1[0].nested1, 0) and not isbound(v_rec.field1.option1[0].nested2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..220c737f905abb4a84963c0cf41425fc0d857f23 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_013.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that mandatory fields are created and uninitialized when expanding omitted record values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_013 { + + type component GeneralComp { + } + + type record R { + record { + integer field1, + charstring field2 + } sub optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_013() runs on GeneralComp { + var R v_rec; + v_rec.sub := omit; + v_rec.sub.field2 := "abc"; + if (isbound(v_rec.sub) and not isbound(v_rec.sub.field1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_013()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c3307325ae8d4f4cf07fc538d53b27eb21da861 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_014.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that optional fields are created and uninitialized when expanding omitted record values (explicit omit) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_014 { + + type component GeneralComp { + } + + type record R { + record { + integer field1 optional, + charstring field2 + } sub optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_014() runs on GeneralComp { + var R v_rec; + v_rec.sub := omit; + v_rec.sub.field2 := "abc"; + if (isbound(v_rec.sub) and not isbound(v_rec.sub.field1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_014()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a62414c4c932cb7cd33fd8e2adfd1c682ccad0dc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_015.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that optional fields are created and omitted when expanding omitted record values (implicit omit) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_015 { + + type component GeneralComp { + } + + type record R { + record { + integer field1 optional, + charstring field2 + } sub optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_015() runs on GeneralComp { + var R v_rec; + v_rec.sub := omit; + v_rec.sub.field2 := "abc"; + if (v_rec.sub == { omit, "abc" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_015()); + } +} with { optional "implicit omit" } diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a04e1799f6497827c5445701a85150c9818f346 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_016.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that referencing fields nested deep inside omitted record invokes expansion + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_016 { + + type component GeneralComp { + } + + type record R { + record { + record { + record { + integer nested1, + integer nested2 + } subfield1, + integer subfield2 + } field1, + charstring field2 + } sub optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_016() runs on GeneralComp { + var R v_rec; + v_rec.sub := omit; + v_rec.sub.field1.subfield1.nested1 := 0; + if (isbound(v_rec.sub) and isbound(v_rec.sub.field1) and not isbound(v_rec.sub.field2) and + isbound(v_rec.sub.field1.subfield1) and not isbound(v_rec.sub.field1.subfield2) and + match(v_rec.sub.field1.subfield1.nested1, 0) and not isbound(v_rec.sub.field1.subfield1.nested2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94c56fb6f52cc8929c6d1592ff78b2bb55667fd1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020101_referencing_fields_of_record_type/Sem_06020101_ReferencingRecordFields_017.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.1.1, verify that expansion of omitted record values works when other constructive types are involved + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing a field of an uninitialized record value or field or omitted field +// (including omitting a field at a higher level of the embedding hierarchy) on the left +// hand side of an assignment, the reference shall recursively be expanded up to and +// including the depth of the referenced subfield as follows: +// a) When expanding a value or value field of record type, the subfield referenced in +// the dot notation shall be set to present and all unreferenced mandatory subfields shall +// be left uninitialized; when the assignment is used in a scope where the optional +// attribute is equal to "explicit omit", all unreferenced optional subfields shall be +// left undefined. When the assignment is used in a scope where the optional attribute is +// equal to "implicit omit", all unreferenced optional subfields shall be set to omit. +// b) Expansion of record of/set of/array, union and set values and intermediate fields +// shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1 +// correspondingly. +// At the end of the expansion, the value at the right hand side of the assignment shall +// be assigned to the referenced subfield. + +module Sem_06020101_ReferencingRecordFields_017 { + + type component GeneralComp { + } + + type record R { + record { + union { + record { + integer nested1, + integer nested2 + } option1[2], + integer option2 + } field1, + charstring field2 + } sub optional + } + + testcase TC_Sem_06020101_ReferencingRecordFields_017() runs on GeneralComp { + var R v_rec; + v_rec.sub := omit; + v_rec.sub.field1.option1[0].nested1 := 0; + if (isbound(v_rec) and isbound(v_rec.sub.field1) and not isbound(v_rec.sub.field2) and + match(v_rec.sub.field1.option1[0].nested1, 0) and not isbound(v_rec.sub.field1.option1[0].nested2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020101_ReferencingRecordFields_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSem_060201_RecordTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSem_060201_RecordTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25f0c4bf71f6c7b546276771e6f4cb2e51e2ebda --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSem_060201_RecordTypeValues_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451, re-numbering done by STF 470 and 487 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060201_RecordTypeValues_001 { + +type component GeneralComp { +} + + type record R { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_NegSem_060201_RecordTypeValues_001() runs on GeneralComp { + + var R v_assigned := { 1, 2 } with { optional "implicit omit" } + template R m_check := { 1, omit, 2, omit, omit } + + if (match(v_assigned,m_check)) { //cannot match undefined components of v_assigned + setverdict(pass); + } + +} + +control { + execute(TC_NegSem_060201_RecordTypeValues_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4db23423303c8f914615da897456679465054d61 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409, re-numbering done by STF470 + ** @version 0.0.1 + ** @purpose 1:6.2, The omit keyword shall not be used for mandatory fields. + ** @verdict pass reject + ***************************************************/ +module NegSyn_060201_RecordTypeValues_001 { + type record MyRecord { + integer field1, + MyRecord field2 optional, + integer field3 + } + const MyRecord c_rec := { + field1 := 5, + field2 := omit, + field3 := omit // not optional + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da14aa4bcb3c0205178cb7a4c14842208270a469 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/NegSyn_060201_RecordTypeValues_002.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409, re-numbering done by STF470 + ** @version 0.0.1 + ** @purpose 1:6.2, The omit keyword shall not be used for mandatory fields. + ** @verdict pass reject + ***************************************************/ +module NegSyn_060201_RecordTypeValues_002 { + type record MyRecord { + integer field1, + MyRecord field2 optional, + integer field3 + } + const MyRecord c_rec := { + field1 := 5, + field2 := -, + field3 := omit // not optional + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de209b0bec9d65db353f978ea198523d8b985d67 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_001.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 451, re-numbering done by STF 470 and 487 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060201_RecordTypeValues_001 { + +type component GeneralComp { +} + + type record R { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060201_RecordTypeValues_001() runs on GeneralComp { + + var R v_assigned := { 1, -, 2 } with { optional "implicit omit" } + template R m_check := { 1, omit, 2, omit, omit } + + if (match(v_assigned,m_check)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060201_RecordTypeValues_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e324f4c0cd7c9fdfb2e53bb698b7aec7d5a68c5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 451, re-numbering done by STF 470 and 487 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060201_RecordTypeValues_002 { + +type component GeneralComp { +} + + type record R { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + + const R c_assigned := { 1, -, 2 } with { optional "implicit omit" } + +testcase TC_Sem_060201_RecordTypeValues_002() runs on GeneralComp { + + template R m_check := { 1, omit, 2, omit, omit } + + if (match(c_assigned,m_check)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060201_RecordTypeValues_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7fca39e16d20c9f4dc33179085d5e701bf076b54 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 451, re-numbering done by STF 470 and 487 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060201_RecordTypeValues_003 { + +type component GeneralComp { +} + + type record R { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060201_RecordTypeValues_003() runs on GeneralComp { + + var R v_assigned := { 1, 2, 3 } with { optional "implicit omit" } + + if ( match(v_assigned.f1,1) + and match(v_assigned.f3,3) + and not ispresent(v_assigned.f4) + and not ispresent(v_assigned.f5) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060201_RecordTypeValues_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e10435900f4d5b2c9c38520413c607025f761c3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Sem_060201_RecordTypeValues_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 (updated by STF 470, 487 and 521) + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060201_RecordTypeValues_004 { + +type component GeneralComp { +} + + type record R { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060201_RecordTypeValues_004() runs on GeneralComp { + + var R v_assigned := { 1, 2 } with { optional "implicit omit" } // f3 stays undefined + if (v_assigned.f1 == 1 and + v_assigned.f2 == 2 and + not isbound(v_assigned.f3) and + not ispresent(v_assigned.f4) and + not ispresent(v_assigned.f5)) { + setverdict(pass); + } else { setverdict(fail); } +} + +control { + execute(TC_Sem_060201_RecordTypeValues_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c65b82d5b3e0a134347d78df3a8b3ac2d33cb49 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_001.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2.1, The element identifiers are local to the record and shall be unique within the record (but do not have to be globally unique). + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060201_RecordTypeValues_001 { + const integer field2 := 4; // do not edit the name + + type record MyRecordType { + integer field1, + MyOtherRecordType field2 optional, + charstring field3 + } + type record MyOtherRecordType { + bitstring field1, + boolean field2 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..baa481cc750b75890d5cbe11a021551419be140b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/060201_toplevel/Syn_060201_RecordTypeValues_002.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2.1, Ensure that the IUT correctly handles empty record definitions. + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060201_RecordTypeValues_002 { + type record MyRecordType { + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d2a4230022dc739c7d7554508b89c8b6a7bd336 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The dot notation used in set type definitions is correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060202_SetTypeValues_001 { + +type component GeneralComp { +} + + type set S { + integer field1 (1 .. 10), + charstring field2 optional + } + + type S ConstrainedSet ({1, omit}, {2, "xyz"}, {3, "zyx"}) ; + + type ConstrainedSet.field1 MyInteger; + +testcase TC_NegSem_060202_SetTypeValues_001() runs on GeneralComp { + + var MyInteger v_int := 11; // assignment from outside of the carried over (1 .. 10) range constraint + +} + +control { + execute(TC_NegSem_060202_SetTypeValues_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..202b2620a4301d690612eebb91e6b3f4ebf0f66f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSem_060202_SetTypeValues_002.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060202_SetTypeValues_002 { + +type component GeneralComp { +} + + type set S { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_NegSem_060202_SetTypeValues_002() runs on GeneralComp { + + var S v_assigned := { 1, 2 } with { optional "implicit omit" } + template S m_check := { 1, omit, 2, omit, omit } + + if (match(v_assigned,m_check)) { //cannot match undefined components of v_assigned + setverdict(pass); + } + +} + +control { + execute(TC_NegSem_060202_SetTypeValues_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7b4691f0a28a6d90dbcc7f798b628636a7b433b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @purpose 1:6.2, The omit keyword shall not be used for mandatory fields. + ** @verdict pass reject + ***************************************************/ +module NegSyn_060202_SetTypeValues_001 { + type set MySet { + integer field1, + MySet field2 optional, + integer field3 + } + const MySet c_set := { + field1 := 5, + field2 := omit, + field3 := omit // not optional + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d02d3ce12a9351e2d440f667756243ba511997f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/NegSyn_060202_SetTypeValues_002.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @purpose 1:6.2, The omit keyword shall not be used for mandatory fields. + ** @verdict pass reject + ***************************************************/ +module NegSyn_060202_SetTypeValues_002 { + type record MySet { + integer field1, + MySet field2 optional, + integer field3 + } + const MySet c_set := { + field1 := 5, + field2 := -, + field3 :=omit // not optional + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10530bf3db2a8861c5e9749184a48746f9eaf72b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The dot notation used in set type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_001 { + +type component GeneralComp { +} + + type set S { + integer field1 (1 .. 10), + charstring field2 optional + } + + type S ConstrainedSet ({1, omit}, {2, "xyz"}, {3, "zyx"}) ; + + type ConstrainedSet.field1 MyInteger; + +testcase TC_Sem_060202_SetTypeValues_001() runs on GeneralComp { + + var MyInteger v_int := 9; // v_int is allowed in (1 .. 10) range + + if (v_int==9) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..245d0b76d0bda7e04f7f19120d08ab4313790721 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The dot notation used in set type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_002 { + +type component GeneralComp { +} + + type set S { + integer field1 (1 .. 10), + charstring field2 optional + } + + type S ConstrainedSet ({1, omit}, {2, "xyz"}, {3, "zyx"}); + + type ConstrainedSet.field2 MyChar; + +testcase TC_Sem_060202_SetTypeValues_002() runs on GeneralComp { + + var MyChar v_char := "abc"; // any character string is allowed + + if (v_char=="abc") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..375594e12072eb22c1dec41196b47e1ded33d2ff --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The dot notation used in set type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_003 { + +type component GeneralComp { +} + + type set S { + integer field1 (1 .. 10), + charstring field2 optional + } + + type S.field1 MyInteger; + +testcase TC_Sem_060202_SetTypeValues_003() runs on GeneralComp { + + var MyInteger v_int := 9; // v_int is allowed in (1 .. 10) range + + if (v_int==9) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..847453a5dddd17617f8d11c7a36e1847f6322b84 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The dot notation used in set type definitions is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_004 { + +type component GeneralComp { +} + + type set S { + integer field1 (1 .. 10), + charstring field2 optional + } + + + type S.field2 MyChar; + +testcase TC_Sem_060202_SetTypeValues_004() runs on GeneralComp { + + var MyChar v_char := "abc"; // any character string is allowed + + if (v_char=="abc") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69a81fda0cf40d2d6f072229994117974868ef3d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_005 { + +type component GeneralComp { +} + + type set S { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060202_SetTypeValues_005() runs on GeneralComp { + + var S v_assigned := { 1, -, 2 } with { optional "implicit omit" } + template S m_check := { 1, omit, 2, omit, omit } + + if (match(v_assigned,m_check)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f89d4d1d14de5100ceb765112b13df13c7664603 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_006.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_006 { + +type component GeneralComp { +} + + type set S { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + + const S c_assigned := { 1, -, 2 } with { optional "implicit omit" } + +testcase TC_Sem_060202_SetTypeValues_006() runs on GeneralComp { + + template S m_check := { 1, omit, 2, omit, omit } + + if (match(c_assigned,m_check)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..368f8e5fd95ec13435f8d4a5478446643123736d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_007.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF470 + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_007 { + +type component GeneralComp { +} + + type record S { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060202_SetTypeValues_007() runs on GeneralComp { + + var S v_assigned := { 1, 2, 3 } with { optional "implicit omit" } + + if ( match(v_assigned.f1,1) + and match(v_assigned.f3,3) + and not ispresent(v_assigned.f4) + and not ispresent(v_assigned.f5) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060202_SetTypeValues_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a656cfe3f18531dd11195aedb937f9aee7cff19 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Sem_060202_SetTypeValues_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF470 (updated by STF 521) + ** @version 0.0.1 + ** @desc Test cases for clause 6.2 + ** @purpose 1:6.2, Ensure that assignments with "implicit omit" attribute are correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060202_SetTypeValues_008 { + +type component GeneralComp { +} + + type set S { + integer f1, + integer f2 optional, + integer f3, + integer f4 optional, + integer f5 optional + } + +testcase TC_Sem_060202_SetTypeValues_008() runs on GeneralComp { + + var S v_assigned := { 1, 2 } with { optional "implicit omit" } //f3 stays undefined + if (v_assigned.f1 == 1 and + v_assigned.f2 == 2 and + not isbound(v_assigned.f3) and + not ispresent(v_assigned.f4) and + not ispresent(v_assigned.f5)) { + setverdict(pass); + } else { setverdict(fail); } +} + +control { + execute(TC_Sem_060202_SetTypeValues_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2a5904ed1c4af422660b9a59563a40858ae86a6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_001.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, The element identifiers are local to the set and shall be unique within the record (but do not have to be globally unique). + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060202_SetTypeValues_001 { + const integer field2 := 4; // do not edit the name + + type set MySetType { + integer field1, + MyOtherSetType field2 optional, + charstring field3 + } + type set MyOtherSetType { + bitstring field1, + boolean field2 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58bb4511bf67f382bf2d72bfd9197edf1e71ae1d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/Syn_060202_SetTypeValues_002.ttcn @@ -0,0 +1,10 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.2, Ensure that the IUT correctly handles empty set definitions. + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_060202_SetTypeValues_002 { + type set MySetType { + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c50739d22153371bbb7be6c30545d9010f7d725 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, ensure that the inner type referencing is correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060203_records_and_sets_of_single_types_001 { + + type component GeneralComp { + } + + type record length (5) of record of integer ConstrainedStructure (1 .. 10); + type ConstrainedStructure[-] RecordOfInt; + +testcase TC_NegSem_060203_records_and_sets_of_single_types_001() runs on GeneralComp { + + var RecordOfInt v_rec := { 8, 11, 2, 3, 4, 5, 6, 7 }; // a value is outside the restricted range + +} + +control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..996b8590ef7269630c435e49f89088d26f340f4f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, ensure that the inner type referencing is correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060203_records_and_sets_of_single_types_002 { + + type component GeneralComp { + } + + type record of record length (5) of integer ConstrainedStructure (1 .. 10); + type ConstrainedStructure[-] RecordOfInt; + +testcase TC_NegSem_060203_records_and_sets_of_single_types_002() runs on GeneralComp { + + var RecordOfInt v_rec := { 8, 1, 2, 3, 4, 5, 6, 7 }; // a record is longer than the restricted length + +} + +control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c64886dcab2f4cbaa6f9288ac3b5c91644e1bf97 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, negative index applied to a record of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_003 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_003() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + var integer i := v_rec[-1]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_003()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3fd6c7958bd5053edbd7e989b6adf7186463e9f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_004.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, negative index applied to a set of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_004 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_004() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + var integer i := v_set[-1]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_004()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..865432e96768169cb76ee0a3b7449fe81e1ce4ae --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_005.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, negative index applied to a record of value on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_005 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_005() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec[-1] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf31b8d5928f041d84bda0940a343c973891fc49 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_006.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, negative index applied to a set of value on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_006 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_006() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set[-1] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_006()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0f09ebe4788d88b5103fb29cdaa6e76011ae8bc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_007.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, wrong index type applied to a record of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_007 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_007() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + var integer i := v_rec["0"]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_007()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa0b86d80817607c4be649d0e8cb0740c76ff800 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_008.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, wrong index type applied to a set of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_008 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_008() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + var integer i := v_set["0"]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_008()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1b973efac1f126c64daa5168f03f83ed6d56b15 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_009.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, wrong index type applied to a record of value on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_009 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_009() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec["0"] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_009()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0201604e57fb5f4cf27b6386d035b501674cadb7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, wrong index type applied to a set of value on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Implicit rule, formal requirement requested in CR 6646 (resolution expected +// in TTCN-3:2014) +module NegSem_060203_records_and_sets_of_single_types_010 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_010() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set["0"] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_010()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0aec135fcf507d07c208f486b4a2e3c1604d8ded --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_011.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, record of index greater than the upper bound (left-hand side) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index value shall not exceed the limitation placed by length subtyping. + +// Note: right-hand side is not tested, because such an element is non-existent +// and it is impossible to find out whether expected error is caused by this +// this requirement or the rule concerning referencing non-existent elements. + +module NegSem_060203_records_and_sets_of_single_types_011 { + + type component GeneralComp { + } + + type record length (0..3) of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_011() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec[3] := 3; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_011()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ec3a5a6bb28f8f3bf20e2d264268debaf64baf5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_012.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, set of index greater than the upper bound (left-hand side) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index value shall not exceed the limitation placed by length subtyping. + +// Note: right-hand side is not tested, because such an element is non-existent +// and it is impossible to find out whether expected error is caused by this +// this requirement or the rule concerning referencing non-existent elements. + +module NegSem_060203_records_and_sets_of_single_types_012 { + + type component GeneralComp { + } + + type set length (0..3) of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_012() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set[3] := 3; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e2ef58b301796d344413ac42866abf1cbc22e2a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_013.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, wrong index type applied to a record of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the value of the element indicated by the index at the right-hand of an +// assignment is undefined (uninitialized), this shall cause a semantic or +// run-time error.) +module NegSem_060203_records_and_sets_of_single_types_013 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_013() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + var integer i := v_rec[3]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_013()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76b7d861d691fb3961e49f11f1f82f5eeb1f933a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_014.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, wrong index type applied to a record of value on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If the value of the element indicated by the index at the right-hand of an +// assignment is undefined (uninitialized), this shall cause a semantic or +// run-time error.) +module NegSem_060203_records_and_sets_of_single_types_014 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_014() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + var integer i := v_set[3]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_014()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e53860678066ac4d8988581e0614b6a99df9bdd7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_015.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify than an error is generated when sending a partially initialized record of value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Undefined elements are permitted only in transient states (while the value +// remains invisible). Sending a record of value with undefined elements shall +// cause a test case error. + +module NegSem_060203_records_and_sets_of_single_types_015 { + + type record of integer RoI; + + type port P message { + inout RoI + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_060203_records_and_sets_of_single_types_015() runs on GeneralComp { + var template RoI mw_sendingTemplate := {0, -, 2}; + p.send(mw_sendingTemplate); // error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_060203_records_and_sets_of_single_types_015()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79a5e85b6a8bb0247235b72b6e17289145f6078b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_016.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on right hand side (less items than record-of dimension) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_016 { + + type component GeneralComp { + } + + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_016() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var integer v_index[3] := { 1, 0, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16915d42ba3e05ab57f8a606e43c4f295ff3171c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_017.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on left hand side (less items than record-of dimension) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_017 { + + type component GeneralComp { + } + + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_017() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var integer v_index[3] := { 1, 0, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_018.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1579369df3a0cf4a90f1a7ad029aa902f92bf340 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_018.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on right hand side (less items than record-of dimension) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_018 { + + type component GeneralComp { + } + + type record length(3) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_018() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_018()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_019.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2cc08c5ef3ed0ea2ea36b55914eec3f52d6b217c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_019.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on left hand side (less items than record-of dimension) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_019 { + + type component GeneralComp { + } + + type record length(3) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_019() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_019()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_020.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aac6af65ea9bc370bc84e7671c77e05854645db4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_020.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size set-of as a record-of value index on right hand side + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_020 { + + type component GeneralComp { + } + + type set length(2) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_020() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_020()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_021.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74ab911f4892e999f00d5eecace5ec48f7f5a483 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_021.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size set-of as a record-of value index on left hand side + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_021 { + + type component GeneralComp { + } + + type set length(2) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_021() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_021()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_022.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..500ff791ca342165551c36aa5cbe88f6b497d7ce --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_022.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, variable-size record-of as a record-of value index on right hand side + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_022 { + + type component GeneralComp { + } + + type record of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_022() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_022()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_023.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a9a5295eac61ad0daf29e010d94398db8c556af --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSem_060203_records_and_sets_of_single_types_023.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, variable-size record-of as a record-of value index on left hand side (less items than record-of dimension) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module NegSem_060203_records_and_sets_of_single_types_023 { + + type component GeneralComp { + } + + type record of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_NegSem_060203_records_and_sets_of_single_types_023() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060203_records_and_sets_of_single_types_023()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSyn_060203_records_and_sets_of_single_types_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSyn_060203_records_and_sets_of_single_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e01697ac56d8814a418d180919a8b363fe22987 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/NegSyn_060203_records_and_sets_of_single_types_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, ensure that value list cannot contain an empty assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// No empty assignment is allowed (e.g. two commas, the second immediately +// following the first or only with white space between them). +module NegSyn_060203_records_and_sets_of_single_types_001 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_NegSyn_060203_records_and_sets_of_single_types_001() runs on GeneralComp { + + var RecordOfInt v_rec := { 0, , 2 }; // syntax error expected + + } + + control { + execute(TC_NegSyn_060203_records_and_sets_of_single_types_001()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86f19d0408d85a52a59251ecfdf9fceb47e94fa6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, ensure that the inner type referencing is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060203_records_and_sets_of_single_types_001 { + + type component GeneralComp { + } + + type record length (5) of record of integer ConstrainedStructure (1 .. 10); + type ConstrainedStructure[-] RecordOfInt; //references the inner record of integer(1..10) + +testcase TC_Sem_060203_records_and_sets_of_single_types_001() runs on GeneralComp { + + var RecordOfInt v_rec := { 8, 1, 2, 3, 4, 5, 6, 7, 9 }; // any record length is allowed + + if (v_rec[7]==7) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060203_records_and_sets_of_single_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c12b376e5f3fbd042ce09d797970a76e8eb3043c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_002.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify assignment of explicitly identified elements to record of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When the assignment notation is used for record of s, elements +// wished to be changed are identified explicitly and either a value +// or the not used symbol "-" can be assigned to them... +// At initialization, only the elements to be assigned values shall be +// specified... It is also possible to leave fields explicitly unspecified +// using the not used symbol "-". +module Sem_060203_records_and_sets_of_single_types_002 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_002() runs on GeneralComp { + + var RoI v_rec := { + [0] := 0, + [1] := 1, + [2] := - + }; + + if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c80c1ab611911ff38a3ba2127fb8c47af3562648 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_003.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify assignment of explicitly identified elements to set of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When the assignment notation is used for set of s, elements +// wished to be changed are identified explicitly and either a value +// or the not used symbol "-" can be assigned to them... +// At initialization, only the elements to be assigned values shall be +// specified... It is also possible to leave fields explicitly unspecified +// using the not used symbol "-". +module Sem_060203_records_and_sets_of_single_types_003 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_003() runs on GeneralComp { + + var SoI v_set := { + [0] := 0, + [1] := 1, + [2] := - + }; + + if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_003()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ce1b2bc850450bce5e1d9d9a4bbbcf5f34ea76b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_004.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of missing elements in assignment notation for record of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When the assignment notation is used for record of s, ... +// fields, not referred to in the notation, shall remain unchanged.... +// At initialization ... elements not mentioned are implicitly left +// uninitialized. +module Sem_060203_records_and_sets_of_single_types_004 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_004() runs on GeneralComp { + + var RoI v_rec := { + [1] := 1 + }; + + if (not isbound(v_rec[0]) and match(v_rec[1], 1)) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_004()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf14c268b1324850324320aae535240eb61d2ee8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of missing elements in assignment notation for set of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When the assignment notation is used for record of s, ... +// fields, not referred to in the notation, shall remain unchanged.... +// At initialization ... elements not mentioned are implicitly left +// uninitialized. +module Sem_060203_records_and_sets_of_single_types_005 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_005() runs on GeneralComp { + + var SoI v_set := { + [1] := 1 + }; + + if (not isbound(v_set[0]) and match(v_set[1], 1)) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9434b5a8439f3aeda9507b992452b6d52e0bf6aa --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_006.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of missing and ignored elements during record of value re-assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When re-assigning a previously initialized value, using the not used symbol +// or just skipping a field or element in an assignment notation, will cause +// that field or element to remain unchanged. +module Sem_060203_records_and_sets_of_single_types_006 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_006() runs on GeneralComp { + + var RoI v_rec := { + [0] := 0, + [1] := -, + [2] := 2 + }; + v_rec := { + [1] := 1 + }; + if (v_rec == { 0, 1, 2 }) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060203_records_and_sets_of_single_types_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a575c89f599f3678fde675e83ba896d837820a3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_007.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of missing and ignored elements during record of value re-assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When re-assigning a previously initialized value, using the not used symbol +// or just skipping a field or element in an assignment notation, will cause +// that field or element to remain unchanged. +module Sem_060203_records_and_sets_of_single_types_007 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_007() runs on GeneralComp { + + var SoI v_set := { + [0] := 0, + [1] := -, + [2] := 2 + }; + v_set := { + [1] := 1 + }; + if (v_set == { 0, 1, 2 }) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_007()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8cf13ed73579698acd411f9635606e681edb546 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_008.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of value list assignment used for initialization of record of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When using the value list notation, all elements in the structure shall +// be specified either with a value or the not used symbol "-". The first +// member of the list is assigned to the first element, the second list +// member is assigned to the second element, etc. +module Sem_060203_records_and_sets_of_single_types_008 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_008() runs on GeneralComp { + + var RoI v_rec := { 0, 1, - }; + if (match(v_rec[0], 0) and match(v_rec[1], 1) and not isbound(v_rec[2])) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_008()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..056975e5d8e4673d6b897efe65b9e73e5fe9bdb3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_009.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of value list assignment used for initialization of set of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When using the value list notation, all elements in the structure shall +// be specified either with a value or the not used symbol "-". The first +// member of the list is assigned to the first element, the second list +// member is assigned to the second element, etc. +module Sem_060203_records_and_sets_of_single_types_009 { + + type component GeneralComp { + } + + type record of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_009() runs on GeneralComp { + + var SoI v_set := { 0, 1, - }; + if (match(v_set[0], 0) and match(v_set[1], 1) and not isbound(v_set[2])) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_009()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91bdad28a392b8ced84bd04a7f8b9ce0dd35270e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_010.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of value list assignment used for update of record of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements to be left out of the assignment shall be explicitly skipped in the list +// by use of the not-used-symbol "-". Already initialized elements left without +// a corresponding list member in a value list notation (i.e. at the end of a list) +// are becoming uninitialized. In this way, a value with initialized elements can be +// made empty by using the empty value list notation ("{}"). +module Sem_060203_records_and_sets_of_single_types_010 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_010() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec := { 10, - }; + if (v_rec == { 10, 1 } ) { + setverdict(pass); + } + else { + setverdict(fail); + } + v_rec := {}; + if (lengthof(v_rec) == 0 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_010()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cdefa282c3ac9662b0ad381f017c421b371dc81b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_011.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of value list assignment used for update of set of values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements to be left out of the assignment shall be explicitly skipped in the list +// by use of the not-used-symbol "-". Already initialized elements left without +// a corresponding list member in a value list notation (i.e. at the end of a list) +// are becoming uninitialized. In this way, a value with initialized elements can be +// made empty by using the empty value list notation ("{}"). +module Sem_060203_records_and_sets_of_single_types_011 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_011() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set := { 10, - }; + if (v_set == { 10, 1 } ) { + setverdict(pass); + } + else { + setverdict(fail); + } + v_set := {}; + if (lengthof(v_set) == 0 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_011()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10ec6dc721bf15ee5c98b3148cf3054e6c14124a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_012.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of index notation applied to record of values on right-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notations can be used on the right-hand side of assignments. +// The index notation, when used on the right hand side, refers to the value of +// the identified element of a record of. +module Sem_060203_records_and_sets_of_single_types_012 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_012() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + var integer i := v_rec[1]; + if (i == 1 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d22d870b71f80dc1b65d495604942700d2ad4f29 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_013.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of index notation applied to set of values on right-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notations can be used on the right-hand side of assignments. +// The index notation, when used on the right hand side, refers to the value of +// the identified element of a record of. +module Sem_060203_records_and_sets_of_single_types_013 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_013() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + var integer i := v_set[1]; + if (i == 1 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_013()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e2b240af45b7101f2e528eb95b4b41f96591973 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_014.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of index notation applied to record of values on left-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notations can be used on the left-hand side of assignments. +// When it is used at the left hand side, only the value of the identified +// single element is changed, values assigned to other elements already remain +// unchanged. +module Sem_060203_records_and_sets_of_single_types_014 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_014() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec[1] := 10; + if (v_rec == { 0, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_014()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32cac50344c8ad47d1844d59a3542eaad520e614 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_015.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify handling of index notation applied to set of values on left-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notations can be used on the left-hand side of assignments. +// When it is used at the left hand side, only the value of the identified +// single element is changed, values assigned to other elements already remain +// unchanged. +module Sem_060203_records_and_sets_of_single_types_015 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_015() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set[1] := 10; + if (v_set == { 0, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_015()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..555af8a757929e6accb0071cac3f9a36381ddbf2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_016.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify the first element of a record of value is accessible by an index notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The index of the first element shall be zero. +module Sem_060203_records_and_sets_of_single_types_016 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_016() runs on GeneralComp { + + var RoI v_rec := { 0, 1, 2 }; + v_rec[0] := 10; // first index on the left hand side + v_rec[1] := v_rec[0]; // first index on the right hand side + if (v_rec == { 10, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82690db8d4b8a949b1083561d479157c7b907262 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_017.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify the first element of a set of value is accessible by an index notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The index of the first element shall be zero. +module Sem_060203_records_and_sets_of_single_types_017 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_017() runs on GeneralComp { + + var SoI v_set := { 0, 1, 2 }; + v_set[0] := 10; // first index on the left hand side + v_set[1] := v_set[0]; // first index on the right hand side + if (v_set == { 10, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_019.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91c8d2b75cd909c56c3e2a5dd20fc7dc68946c60 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_019.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, referencing non-existent element of record of value (left-hand side) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If an indexing operator at the left-hand side of an assignment refers to +// a non-existent element, the value at the right-hand side is assigned to +// the element and all elements with an index smaller than the actual index +// and without assigned value are created with an undefined value. +module Sem_060203_records_and_sets_of_single_types_019 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_019() runs on GeneralComp { + + var RoI v_rec := { 0, 1 }; + v_rec[3] := 3; // {0, 1, -, 3} + if (match(v_rec[0], 0) and + match(v_rec[1], 1) and + not isbound(v_rec[2]) and + match(v_rec[3], 3)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_019()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_020.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c428d079c80f1020fc6dcade820751d6624a772 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_020.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, referencing non-existent element of set of value (left-hand side) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If an indexing operator at the left-hand side of an assignment refers to +// a non-existent element, the value at the right-hand side is assigned to +// the element and all elements with an index smaller than the actual index +// and without assigned value are created with an undefined value. +module Sem_060203_records_and_sets_of_single_types_020 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_020() runs on GeneralComp { + + var SoI v_set := { 0, 1 }; + v_set[3] := 3; // {0, 1, -, 3} + if (match(v_set[0], 0) and + match(v_set[1], 1) and + not isbound(v_set[2]) and + match(v_set[3], 3)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_020()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_021.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8adadc0b2588a8f657ec7791b9e1cbec7ec263c9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_021.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, referencing element of uninitialized record of value (left-hand side) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If an indexing operator at the left-hand side of an assignment refers to +// a non-existent element, the value at the right-hand side is assigned to +// the element and all elements with an index smaller than the actual index +// and without assigned value are created with an undefined value. +module Sem_060203_records_and_sets_of_single_types_021 { + + type component GeneralComp { + } + + type record of integer RoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_021() runs on GeneralComp { + + var RoI v_rec; + v_rec[2] := 2; // {-, -, 2} + if (not isbound(v_rec[0]) and + not isbound(v_rec[1]) and + match(v_rec[2], 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_021()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_022.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6669fe516360405ee7cbe8f2ab5b6afb414d9692 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_022.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3, referencing element of uninitialized set of value (left-hand side) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If an indexing operator at the left-hand side of an assignment refers to +// a non-existent element, the value at the right-hand side is assigned to +// the element and all elements with an index smaller than the actual index +// and without assigned value are created with an undefined value. +module Sem_060203_records_and_sets_of_single_types_022 { + + type component GeneralComp { + } + + type set of integer SoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_022() runs on GeneralComp { + + var SoI v_set; + v_set[2] := 2; // {-, -, 2} + if (not isbound(v_set[0]) and + not isbound(v_set[1]) and + match(v_set[2], 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_022()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_023.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..706d54994180fd6ca9733f5a25f820ca09efaec6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_023.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on right hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_023 { + + type component GeneralComp { + } + + type record of record of integer RoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_023() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var integer v_index[2] := { 1, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_023()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_024.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8086bdfe229986475bcfd8d5591e91d6ed391a94 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_024.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on left hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_024 { + + type component GeneralComp { + } + + type record of record of integer RoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_024() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var integer v_index[2] := { 1, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_024()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_025.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91101adcd289f19c5a2ec6394fa3effc0d3a0747 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_025.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on right hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_025 { + + type component GeneralComp { + } + + type record of record of record of integer RoRoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_025() runs on GeneralComp { + + var RoRoRoI v_rec := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var integer v_index[2] := { 1, 0 } + if (v_rec[v_index] == {4, 5, 6}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_025()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_026.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fc0e16be685ec16312a8ff1cdcc30c50ef3e330 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_026.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a record-of value index on left hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_026 { + + type component GeneralComp { + } + + type record of record of record of integer RoRoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_026() runs on GeneralComp { + + var RoRoRoI v_rec := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var integer v_index[2] := { 1, 0 } + v_rec[v_index] := { 100, - }; + if (v_rec == {{{0, 1}, {2, 3}}, {{100, 5}, {7, 8}}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_026()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_027.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99c4f9df7ab454f3875f49d57aedfb1ac1d3fa31 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_027.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on right hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_027 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_027() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + if (v_rec[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_027()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_028.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22aa8fc2fed2666b53f481af3faa937d49999d70 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_028.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on left hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_028 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type record of record of integer RoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_028() runs on GeneralComp { + + var RoRoI v_rec := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + v_rec[v_index] := 10; + if (v_rec == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_028()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_029.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..978422b6011d91e2d2eba692ad75f11f18356b74 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_029.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on right hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_029 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type record of record of record of integer RoRoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_029() runs on GeneralComp { + + var RoRoRoI v_rec := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var Indexer v_index := { 1, 0 } + if (v_rec[v_index] == {4, 5, 6}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_029()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_030.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4087bf3ccd225f4a918602e7ea08e074dfa0932e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_030.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a record-of value index on left hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_030 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type record of record of record of integer RoRoRoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_030() runs on GeneralComp { + + var RoRoRoI v_rec := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var Indexer v_index := { 1, 0 } + v_rec[v_index] := { 100, - }; + if (v_rec == {{{0, 1}, {2, 3}}, {{100, 5}, {7, 8}}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_030()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_031.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ece82f569a7637051cd9878e79f633217f0b1ceb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_031.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a set-of value index on right hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_031 { + + type component GeneralComp { + } + + type set of set of integer SoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_031() runs on GeneralComp { + + var SoSoI v_set := {{0, 1}, {2, 3}}; + var integer v_index[2] := { 1, 0 } + if (v_set[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_031()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_032.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c3125873c41a7599c46e943f3897549f0ab29615 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_032.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a set-of value index on left hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_032 { + + type component GeneralComp { + } + + type set of set of integer SoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_032() runs on GeneralComp { + + var SoSoI v_set := {{0, 1}, {2, 3}}; + var integer v_index[2] := { 1, 0 } + v_set[v_index] := 10; + if (v_set == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_032()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_033.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36e15f59a4f82d9b98840a84865254e57a6834f2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_033.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a set-of value index on right hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_033 { + + type component GeneralComp { + } + + type set of set of set of integer SoSoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_033() runs on GeneralComp { + + var SoSoSoI v_set := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var integer v_index[2] := { 1, 0 } + if (v_set[v_index] == {4, 5, 6}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_033()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_034.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b55a5db058f09d1e349bb0e7a4b0312619d8f031 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_034.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, array as a set-of value index on left hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_034 { + + type component GeneralComp { + } + + type set of set of set of integer SoSoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_034() runs on GeneralComp { + + var SoSoSoI v_set := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var integer v_index[2] := { 1, 0 } + v_set[v_index] := { 100, - }; + if (v_set == {{{0, 1}, {2, 3}}, {{100, 5}, {7, 8}}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_034()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_035.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ec4d40b8022c8a4021885fabfbce073be504a01 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_035.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size set-of as a record-of value index on right hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_035 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type set of set of integer SoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_035() runs on GeneralComp { + + var SoSoI v_set := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + if (v_set[v_index] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_035()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_036.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6471400097ab2a981f40c478870c0b8c94f32b62 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_036.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size set-of as a record-of value index on left hand side (dimensions match) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_036 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type set of set of integer SoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_036() runs on GeneralComp { + + var SoSoI v_set := {{0, 1}, {2, 3}}; + var Indexer v_index := { 1, 0 } + v_set[v_index] := 10; + if (v_set == {{0, 1}, {10, 3}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_036()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_037.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ab8be6f33505aff8f503a7a18ee871f5acfbc51 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_037.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size set-of as a record-of value index on right hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_037 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type set of set of set of integer SoSoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_037() runs on GeneralComp { + + var SoSoSoI v_set := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var Indexer v_index := { 1, 0 } + if (v_set[v_index] == {4, 5, 6}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_037()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_038.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a15b24a63fd8b6789f00e7ccb72876b9dae6522 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060203_records_and_sets_of_single_types/Sem_060203_records_and_sets_of_single_types_038.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.3, fixed-size record-of as a set-of value index on left hand side (less items than record-of dimension) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For nested record of or set of types, an array or record of integer restricted +// to a single size can be used as a short-hand notation for a nested index +// notation. + +module Sem_060203_records_and_sets_of_single_types_038 { + + type component GeneralComp { + } + + type record length(2) of integer Indexer; + type set of set of set of integer SoSoSoI; + + testcase TC_Sem_060203_records_and_sets_of_single_types_038() runs on GeneralComp { + + var SoSoSoI v_set := {{{0, 1}, {2, 3}}, {{4, 5, 6}, {7, 8}}}; + var Indexer v_index := { 1, 0 } + v_set[v_index] := { 100, - }; + if (v_set == {{{0, 1}, {2, 3}}, {{100, 5}, {7, 8}}}) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060203_records_and_sets_of_single_types_038()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35eae66a307bb066d5137696eb39d62ed4a43669 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, not unique identifiers in enumerated type declaration + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The identifiers of enumerated values shall be unique within the enumerated type +// (but do not have to be globally unique) and are consequently visible in the +// context of the given type only. + +module NegSem_060204_enumerated_type_and_values_001 { + + type enumerated MyFirstEnumType { + Monday, Tuesday, Wednesday, Thursday, Friday, Monday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f7b11deba7dc84503a395c2a361efe42669c38a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_002.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, two equal user-assigned enumerated values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Each user-assigned integer number shall be distinct within a single enumerated +// type. + +module NegSem_060204_enumerated_type_and_values_002 { + + type enumerated MyFirstEnumType { + Monday, Tuesday(2), Wednesday(2), Thursday, Friday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a71f45c5e1ff2d3d6e7e6f61d82a66c864493e15 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value number directly (left hand side of assignments) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For each enumerated value without an assigned integer value, the system +// successively associates an integer number in the textual order of the +// enumerated values, starting at the left-hand side, beginning with zero, by +// step 1 and skipping any number occupied by any of the enumerated values with +// a manually assigned value. These values are only used by the system to allow +// the use of relational operators. The user shall not directly use associated +// integer values but can access them and convert integer values into enumerated +// values by using the predefined functions enum2int and int2enum (see clauses +// 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4). + +module NegSem_060204_enumerated_type_and_values_003 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + + testcase TC_NegSem_060204_enumerated_type_and_values_003() runs on GeneralComp { + var EDays v_day0 := 0; // ordinal value shall not be accepted + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_003()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ebdbc13eb66024647a931cd1565920a36e162a1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value number directly (right hand side of assignments) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For each enumerated value without an assigned integer value, the system +// successively associates an integer number in the textual order of the +// enumerated values, starting at the left-hand side, beginning with zero, by +// step 1 and skipping any number occupied by any of the enumerated values with +// a manually assigned value. These values are only used by the system to allow +// the use of relational operators. The user shall not directly use associated +// integer values but can access them and convert integer values into enumerated +// values by using the predefined functions enum2int and int2enum (see clauses +// 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4). + +module NegSem_060204_enumerated_type_and_values_004 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + + testcase TC_NegSem_060204_enumerated_type_and_values_004() runs on GeneralComp { + var EDays v_day0 := Monday; + var integer v_int := v_day0; + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_004()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a05453a0bc4c04bcc3691f05b767ef95244b37a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_005.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value without implicit or explicit type reference + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For any instantiation or value reference of an enumerated type, the given +// type shall be implicitly or explicitly referenced. + +module NegSem_060204_enumerated_type_and_values_005 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + + testcase TC_NegSem_060204_enumerated_type_and_values_005() runs on GeneralComp { + if (Tuesday != Wednesday) { // no implicit or explicit reference to enumeration + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_005()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b3f11659332d64d451b62878ce497be0b68505f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_006.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, modulepar with the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_006 { + + import from NegSem_060204_enumerated_type_and_values_006_import all; + + type component GeneralComp { + } + + modulepar EDays Monday := Tuesday; + + testcase TC_NegSem_060204_enumerated_type_and_values_006() runs on GeneralComp { + log(Monday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_006()); + } +} + +module NegSem_060204_enumerated_type_and_values_006_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45bd66559bdce79df7703b7cde50b781ff3230f6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_007.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, formal parameter with the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_007 { + + import from NegSem_060204_enumerated_type_and_values_007_import all; + + type component GeneralComp { + } + + function f_test(EDays Monday) { + log(Monday); + } + + testcase TC_NegSem_060204_enumerated_type_and_values_007() runs on GeneralComp { + f_test(Tuesday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_007()); + } +} + +module NegSem_060204_enumerated_type_and_values_007_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9cb22b068ae826a0d0882a3d595c1b17650f14b5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_008.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, constant with the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_008 { + + import from NegSem_060204_enumerated_type_and_values_008_import all; + + type component GeneralComp { + } + + const EDays Monday := Tuesday; + + testcase TC_NegSem_060204_enumerated_type_and_values_008() runs on GeneralComp { + log(Monday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_008()); + } +} + +module NegSem_060204_enumerated_type_and_values_008_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4ff06b1c721b2e9a4b1369fac2de07e115917ac --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, variable with the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_009 { + + import from NegSem_060204_enumerated_type_and_values_009_import all; + + type component GeneralComp { + } + + testcase TC_NegSem_060204_enumerated_type_and_values_009() runs on GeneralComp { + var EDays Monday := Tuesday; + log(Monday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_009()); + } +} + +module NegSem_060204_enumerated_type_and_values_009_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16738ea584361e7d395627d81b1e9ea5dde12fe8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_010.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, template with the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_010 { + + import from NegSem_060204_enumerated_type_and_values_010_import all; + + type component GeneralComp { + } + + template EDays Monday := Tuesday; + + testcase TC_NegSem_060204_enumerated_type_and_values_010() runs on GeneralComp { + log(Monday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_010()); + } +} + +module NegSem_060204_enumerated_type_and_values_010_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1ed5f4233633fff9e90b673dc0b7d14508d2dbd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_011.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, parameterized template with default parameters and the same name as one of enumerated values of the imported parent type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module NegSem_060204_enumerated_type_and_values_011 { + + import from NegSem_060204_enumerated_type_and_values_011_import all; + + type component GeneralComp { + } + + template EDays Monday(EDays p_par1 := Tuesday) := ( Friday, p_par1 ); + + testcase TC_NegSem_060204_enumerated_type_and_values_011() runs on GeneralComp { + log(Monday); + setverdict(pass); + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_011()); + } +} + +module NegSem_060204_enumerated_type_and_values_011_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5197fd629988e95d8452d53e05bd829430f31a4d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSem_060204_enumerated_type_and_values_013.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value number integer conversion + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// enumerated values with a specific integer value assigned shall not use the associated integer + +module NegSem_060204_enumerated_type_and_values_013 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(-1), Tuesday(1), Wednesday(2), Thursday(3), Friday(5) + }; + + testcase TC_NegSem_060204_enumerated_type_and_values_013() runs on GeneralComp { + var EDays v_enum := Friday(5); // error: shall not use the associated integer + + if (match(enum2int(v_enum),5)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_060204_enumerated_type_and_values_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b49c841e8ecb326292854a9c25e3bcbb65091a8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, constant as user-assigned enumerated values + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Each enumerated value may optionally have a user-assigned integer value, which +// is defined after the name of the enumerated value in parenthesis. + +module NegSyn_060204_enumerated_type_and_values_002 { + + const integer c_int := 5; + type enumerated MyFirstEnumType { + Monday, Tuesday(c_int), Wednesday, Thursday, Friday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..671a34817a4e8b8762a7090a77c17dd10ba6013c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_002.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, expression as user-assigned enumerated value + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Each enumerated value may optionally have a user-assigned integer value, which +// is defined after the name of the enumerated value in parenthesis. + +module NegSyn_060204_enumerated_type_and_values_003 { + + type enumerated MyFirstEnumType { + Monday, Tuesday(2+3), Thursday, Friday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fe6fc42b472372b2bccb57ca2d0400f5478bd58 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/NegSyn_060204_enumerated_type_and_values_004.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.4, expression as user-assigned enumerated value + ** @verdict pass reject, noexecutino + ***************************************************/ + +// The following requirement is tested: +// ach enumerated value may optionally have a user-assigned integer value or non-empty list of integer literal values or ranges of integer literal values + +module NegSyn_060204_enumerated_type_and_values_004 { + + type enumerated MyFirstEnumType { + Monday, Tuesday(), Thursday, Friday + }; // error: non-empty integer literal required +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cc26ec862f72b26c3df35b647a55078066201584 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, reusing enumerated value identifier in another enumerated type declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// The identifiers of enumerated values shall only be reused within other structured +// type definitions and shall not be used for identifiers of local or global +// visibility at the same or a lower level of the same branch of the scope hierarchy +// (see scope hierarchy in clause 5.2). + +module Sem_060204_enumerated_type_and_values_001 { + + type enumerated MyFirstEnumType { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + type enumerated MySecondEnumType { + Saturday, Sunday, Monday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd34876e332cbce14d97a2003ec4abd78ab18ce1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_002.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, automatic numbering of enumerated items + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each enumerated value without an assigned integer value, the system +// successively associates an integer number in the textual order of the +// enumerated values, starting at the left-hand side, beginning with zero, by +// step 1 and skipping any number occupied by any of the enumerated values with +// a manually assigned value. These values are only used by the system to allow +// the use of relational operators. The user shall not directly use associated +// integer values but can access them and convert integer values into enumerated +// values by using the predefined functions enum2int and int2enum (see clauses +// 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4). + +module Sem_060204_enumerated_type_and_values_002 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + + testcase TC_Sem_060204_enumerated_type_and_values_002() runs on GeneralComp { + var EDays v_day0 := Monday, v_day2 := Wednesday, v_day4 := Friday; + + if (enum2int(v_day0) == 0 and enum2int(v_day2) == 2 and enum2int(v_day4) == 4) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_002()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..388520895c0acea452b0ec3a0ce0ef1de429c335 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, explicit numbering of enumerated items + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each enumerated value without an assigned integer value, the system +// successively associates an integer number in the textual order of the +// enumerated values, starting at the left-hand side, beginning with zero, by +// step 1 and skipping any number occupied by any of the enumerated values with +// a manually assigned value. These values are only used by the system to allow +// the use of relational operators. The user shall not directly use associated +// integer values but can access them and convert integer values into enumerated +// values by using the predefined functions enum2int and int2enum (see clauses +// 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4). + +module Sem_060204_enumerated_type_and_values_003 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(-1), Tuesday(4), Wednesday(0), Thursday(6), Friday(20) + }; + + testcase TC_Sem_060204_enumerated_type_and_values_003() runs on GeneralComp { + var EDays v_day0 := Monday, v_day2 := Wednesday, v_day4 := Friday; + + if (enum2int(v_day0) == -1 and enum2int(v_day2) == 0 and enum2int(v_day4) == 20) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_003()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6fce1bbfb61c5a66d6fa6c4d6e3f953f22ff4e7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, mixed automatic and explicit numbering of enumerated items + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each enumerated value without an assigned integer value, the system +// successively associates an integer number in the textual order of the +// enumerated values, starting at the left-hand side, beginning with zero, by +// step 1 and skipping any number occupied by any of the enumerated values with +// a manually assigned value. These values are only used by the system to allow +// the use of relational operators. The user shall not directly use associated +// integer values but can access them and convert integer values into enumerated +// values by using the predefined functions enum2int and int2enum (see clauses +// 16.1.2, C.1.29 C.1.30 and C.1.4 C.1.4). + +module Sem_060204_enumerated_type_and_values_004 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(1), Tuesday, Wednesday, Thursday(10), Friday + }; + + testcase TC_Sem_060204_enumerated_type_and_values_004() runs on GeneralComp { + var EDays v_day0 := Monday, v_day2 := Wednesday, v_day4 := Friday; + + if (enum2int(v_day0) == 1 and enum2int(v_day2) == 2 and enum2int(v_day4) == 3) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_004()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70ce249774924f6653d24fd4c3d465e3ecbadd9a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_005.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, using enumerated value with implicit type reference + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For any instantiation or value reference of an enumerated type, the given +// type shall be implicitly or explicitly referenced. + +module Sem_060204_enumerated_type_and_values_005 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; + + testcase TC_Sem_060204_enumerated_type_and_values_005() runs on GeneralComp { + var EDays v_day := Monday; + if (v_day == Monday) { //the type of variable v_day identifies the type context of EDays for the equality operator + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_005()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b70b6da9fd99f3be5c986ad287d0f9d8abd730d7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, parameterized template without default parameters and with the same name as one of enumerated values of the imported parent type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When a TTCN-3 module parameter, formal parameter, constant, variable, +// non-parameterized template or parameterized template with all formal +// parameters having default values of an imported enumerated type is defined, +// the name of that definition shall not be the same as any of the enumerated +// values of that type. + +module Sem_060204_enumerated_type_and_values_006 { + + import from Sem_060204_enumerated_type_and_values_006_import all; + + type component GeneralComp { + } + + template EDays Monday(EDays p_par1) := ( Friday, p_par1 ); + + testcase TC_Sem_060204_enumerated_type_and_values_006() runs on GeneralComp { + setverdict(pass); + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_006()); + } +} + +module Sem_060204_enumerated_type_and_values_006_import { + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06233ab36f4c1b0f55621889d5184e4a01b62e3a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Sem_060204_enumerated_type_and_values_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.4, mixed automatic and explicit numbering of enumerated items + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* For each enumerated value without an assigned integer value, + the system successively associates an integer number in the textual + order of the enumerated values, starting at the left-hand side, + beginning with zero, by step 1 and skipping any number occupied by any + of the enumerated values with a manually assigned value or value list. +*/ +module Sem_060204_enumerated_type_and_values_007 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(1), Tuesday, Wednesday, Thursday(10), Friday(11..30) + }; + + testcase TC_Sem_060204_enumerated_type_and_values_007() runs on GeneralComp { + var EDays v_day0 := Monday, v_day2 := Wednesday, v_day4 := Friday(15); + + if (enum2int(v_day0) == 1 and enum2int(v_day2) == 2 and enum2int(v_day4) == 15) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060204_enumerated_type_and_values_007()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..233a4015b069dc06bdb5a3869523b71a7bc8ddeb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, enumerated type declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN 3 supports enumerated types. Enumerated types are used to model types +// that take only a distinct named set of values. Such distinct values are called +// enumerated values. Each enumerated value shall have an identifier. + +module Syn_060204_enumerated_type_and_values_001 { + + type enumerated MyFirstEnumType { + Monday, Tuesday, Wednesday, Thursday, Friday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d9c0dcca3d723772b50a9f68f54ea8705a88d9b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060204_enumerated_type_and_values/Syn_060204_enumerated_type_and_values_002.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.4, enumerated type declaration with user-assigned values + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Each enumerated value may optionally have a user-assigned integer value, which +// is defined after the name of the enumerated value in parenthesis. + +module Syn_060204_enumerated_type_and_values_002 { + + type enumerated MyFirstEnumType { + Monday, Tuesday(2), Wednesday(-1), Thursday, Friday + }; +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aba47555f915d64d70a9778b64a58dc75365d6e4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_001.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, unknown union alternative in value dot notation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Alternatives of a union type shall be referenced by the dot notation +// TypeIdOrExpression.AlternativeId, where TypeIdOrExpression resolves to the name +// of a union type or an expression of a union type such as variable, formal +// parameter, module parameter, constant, template, or function invocation. +// AlternativeId shall resolve to the name of an alternative in the union type. + +module NegSem_06020501_referencing_fields_of_union_type_001 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_001() runs on GeneralComp { + var U v_union; + v_union.option3 := 1; + if (ischosen(v_union.option1) or ischosen(v_union.option2)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5463d9a34a10281dbee99a8515c4887e7833285a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, unknown union alternative in extended type reference + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Alternatives of a union type shall be referenced by the dot notation +// TypeIdOrExpression.AlternativeId, where TypeIdOrExpression resolves to the name +// of a union type or an expression of a union type such as variable, formal +// parameter, module parameter, constant, template, or function invocation. +// AlternativeId shall resolve to the name of an alternative in the union type. + +module NegSem_06020501_referencing_fields_of_union_type_002 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + type U.option3 UnionItem; + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_002() runs on GeneralComp { + var UnionItem v_val := 1; + if (v_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a482f88ba0c5b5661c044c6f464de688b547542 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, union alternative referencing itself + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Alternatives of union type definitions shall not reference themselves. + +module NegSem_06020501_referencing_fields_of_union_type_003 { + type component GeneralComp { + } + + type union U { + integer option1, + U.option2 option2 + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_003() runs on GeneralComp { + var U v_union := { option1 := 1 }; + if (v_union == { option1 := 1}) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e64100c1f9051ea1764f5d75a673def94af53ba --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_004.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, union alternative referencing indirectly itself + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Alternatives of union type definitions shall not reference themselves. + +module NegSem_06020501_referencing_fields_of_union_type_004 { + type component GeneralComp { + } + + type union U { + integer option1, + U.option3 option2, + U.option2 option3 + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_004() runs on GeneralComp { + var U v_union := { option1 := 1 }; + if (v_union == { option1 := 1}) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b34f73fcaa26112f47d5fef792e4e8ddba0e68e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_005.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, union alternative costraint passed through extended type reference + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If an alternative in a union type or a subtype of a union type is referenced by +// the dot notation, the resulting type is the set of values allowed for that +// alternative imposed by the constraints of the alternative declaration itself +// (i.e. any constraints applied to the union type itself are ignored). + +module NegSem_06020501_referencing_fields_of_union_type_005 { + type component GeneralComp { + } + + type union U { + integer option1 (1..10), + charstring option2 + } + + type U.option1 UnionItem; + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_005() runs on GeneralComp { + var UnionItem v_val := 100; + if (v_val == 100) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d5d6439bc7a5a9f7a8564c60c12a9ff754dd1b06 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_006.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing not chosen alternative on right hand side of assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When an alternative of a union type is referenced on the right hand side of +// an assignment an error shall occur if the referenced alternative is not the +// currently chosen alternative or if the referenced union field or value is omitted +// or uninitialized. + +module NegSem_06020501_referencing_fields_of_union_type_006 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_006() runs on GeneralComp { + var U v_union := { option1 := 1 }; + if (v_union.option2 != "test") { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f5f15c9247ef80fc70419e561deb2d876769ec8d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_007.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing alternative of uninitialized union on right hand side of assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When an alternative of a union type is referenced on the right hand side of +// an assignment an error shall occur if the referenced alternative is not the +// currently chosen alternative or if the referenced union field or value is omitted +// or uninitialized. + +module NegSem_06020501_referencing_fields_of_union_type_007 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + type record R { + integer field1, + U field2 + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_007() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 5; + if (v_rec.field2.option1 != 100) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65e78d2d05b4290269f7c2ce8c05c2aee6dec2b4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/NegSem_06020501_referencing_fields_of_union_type_008.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing alternative of omitted union on right hand side of assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// When an alternative of a union type is referenced on the right hand side of +// an assignment an error shall occur if the referenced alternative is not the +// currently chosen alternative or if the referenced union field or value is omitted +// or uninitialized. + +module NegSem_06020501_referencing_fields_of_union_type_008 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + type record R { + integer field1, + U field2 optional + } + + testcase TC_NegSem_06020501_referencing_fields_of_union_type_008() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 5; + v_rec.field2 := omit; + if (v_rec.field2.option1 != 100) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_06020501_referencing_fields_of_union_type_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15aae43ce9b942d1e49e8e86a71b53e7b96186fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_001.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union is initialized by dot notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_06020501_referencing_fields_of_union_type_001 { + type union MyUnionType + { + integer number, + charstring string + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_001 () runs on GeneralComp { + var MyUnionType v_mut ; + v_mut.number := 0; + + if (v_mut.number == 0) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_001()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e328eb919d38e418f0ab06967881688717437220 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, union alternative in extended type reference + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Alternatives of a union type shall be referenced by the dot notation +// TypeIdOrExpression.AlternativeId, where TypeIdOrExpression resolves to the name +// of a union type or an expression of a union type such as variable, formal +// parameter, module parameter, constant, template, or function invocation. +// AlternativeId shall resolve to the name of an alternative in the union type. + +module Sem_06020501_referencing_fields_of_union_type_002 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + type U.option1 UnionItem; + + testcase TC_Sem_06020501_referencing_fields_of_union_type_002() runs on GeneralComp { + var UnionItem v_val := 1; + if (v_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_06020501_referencing_fields_of_union_type_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..801a1f76a8ab6624c045e9e9fd30aa14b7373097 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_003.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, union costraint not applied to extended type reference to its item + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If an alternative in a union type or a subtype of a union type is referenced by +// the dot notation, the resulting type is the set of values allowed for that +// alternative imposed by the constraints of the alternative declaration itself +// (i.e. any constraints applied to the union type itself are ignored). + +module Sem_06020501_referencing_fields_of_union_type_003 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + type U ConstrainedU ( {option1 := 1 }, { option1 := 2}); + type ConstrainedU.option1 UnionItem; + + testcase TC_Sem_06020501_referencing_fields_of_union_type_003() runs on GeneralComp { + var UnionItem v_val := 100; + if (v_val == 100) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_06020501_referencing_fields_of_union_type_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf9f69b56bac58d3d0ee6f6e34831fa8ebcf3b99 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing alternative on left hand side of assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing an alternative of a union type on the left hand side of +// an assignment, the referenced alternative shall become the chosen one. This rule +// shall apply recursively if the reference contains alternatives of nested unions, +// choosing all the referenced alternatives. + +module Sem_06020501_referencing_fields_of_union_type_004 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_Sem_06020501_referencing_fields_of_union_type_004() runs on GeneralComp { + var U v_union; + v_union.option1 := 1; + if (v_union.option1 == 1) { setverdict(pass); } + else { setverdict(fail); } + + v_union.option2 := "test"; + if (v_union.option2 == "test") { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_06020501_referencing_fields_of_union_type_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17917c728f74d98e3d25e7f9ceafe64e6de1c5eb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_005.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing nested alternative on left hand side of assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing an alternative of a union type on the left hand side of +// an assignment, the referenced alternative shall become the chosen one. This rule +// shall apply recursively if the reference contains alternatives of nested unions, +// choosing all the referenced alternatives. + +module Sem_06020501_referencing_fields_of_union_type_005 { + type component GeneralComp { + } + + type union SubU { + integer suboption1, + charstring suboption2 + } + + type union U { + integer option1, + SubU option2 + } + + testcase TC_Sem_06020501_referencing_fields_of_union_type_005() runs on GeneralComp { + var U v_union; + v_union.option1 := 1; + if (v_union.option1 == 1) { setverdict(pass); } + else { setverdict(fail); } + + v_union.option2.suboption2 := "test"; + if (v_union.option2.suboption2 == "test") { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_06020501_referencing_fields_of_union_type_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a24841820552dc96eab3ce5280e1651a58f8b5a3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_006.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.1, referencing field of structured alternative on left hand side of assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing an alternative of an uninitialized union value or field or +// omitted field (including omitting a field at a higher level of the embedding +// hierarchy) on the left hand side of an assignment, the reference shall +// recursively be expanded up to and including the depth of the referenced +// alternative as follows: +// a) When expanding a value or value field of union type, the alternative +// referenced in the dot notation becomes the chosen one. +// b) Expansion of record, record of, set, set of, and array values and intermediate +// fields shall follow the rules of item a) in clauses 6.2.1.1and 6.2.3, and clause +// 6.2.2.1 correspondingly. +// c) At the end of the expansion, the value at the right hand side of the assignment +// shall be assigned to the referenced alternative. + +module Sem_06020501_referencing_fields_of_union_type_006 { + type component GeneralComp { + } + + type record of integer RI; + type record R { + RI field1, + integer field2 + } + + type union U { + integer option1, + R option2 + } + + testcase TC_Sem_06020501_referencing_fields_of_union_type_006() runs on GeneralComp { + var U v_union; + v_union.option2.field1[1] := 10; + + if (ischosen(v_union.option2) and isbound(v_union.option2.field1) and + not isbound(v_union.option2.field2) and not isbound(v_union.option2.field1[0]) and + v_union.option2.field1[1] == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_06020501_referencing_fields_of_union_type_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5a3cf68eb56499b09325929870783c5dfe29e1e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_007.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union is initialized by anytype dot notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/*The following requirement is tested: + * AlternativeId shall resolve to the name of an alternative in the union type or + * in case of an anytype value or template AlternativeId shall resolve to a known type name + * or a known type name qualified with a module name. + */ + +module Sem_06020501_referencing_fields_of_union_type_007 { + type union MyUnionType + { + integer number, + anytype string + }; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_007 () runs on GeneralComp { + var MyUnionType v_mut ; + v_mut.string.integer := 3; // AlternativeID shall resolve type e.g. integer + + if (v_mut.string.integer == 3) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_007()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ea0c051cda1973b8ea4ab41f6e790b246d21592 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020501_referencing_fields_of_union_type/Sem_06020501_referencing_fields_of_union_type_008.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.5.2, Ensure that union is initialized by anytype dot notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * AlternativeId shall resolve to the name of an alternative in the union type or + * in case of an anytype value or template AlternativeId shall resolve to a known type name + * or a known type name qualified with a module name. + */ + +module Sem_06020501_referencing_fields_of_union_type_008 { + type union MyUnionType + { + integer number, + anytype string + }; + type integer My_Int; + + type component GeneralComp { + }; + + + testcase TC_Sem_06020501_referencing_fields_of_union_type_008 () runs on GeneralComp { + var MyUnionType v_mut ; + v_mut.string.My_Int := 3; // AlternativeID shall resolve type e.g. My_Int + + if (v_mut.string.My_Int == 3) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_06020501_referencing_fields_of_union_type_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020502_option_and_union/NegSyn_06020502_option_and_union_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020502_option_and_union/NegSyn_06020502_option_and_union_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b5967edbb73ce7168e71d9762b7aed1eccdb01f2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020502_option_and_union/NegSyn_06020502_option_and_union_001.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5.2, referencing alternative on left hand side of assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Optional fields are not allowed for the union type, which means that the optional +// keyword shall not be used with union types. + +module NegSyn_06020502_option_and_union_001 { + type union U { + integer option1, + charstring option2 optional + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020503_nested_type_definition_for_field_types/Syn_06020503_nested_type_definition_for_field_types_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020503_nested_type_definition_for_field_types/Syn_06020503_nested_type_definition_for_field_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..944454852455d161297d9e7148a32a2fa43c4d21 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020503_nested_type_definition_for_field_types/Syn_06020503_nested_type_definition_for_field_types_001.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, union type declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the definition of types for union alternatives nested within +// the union definition, similar to the mechanism for record types described in +// clause 6.2.1.3. + +module Syn_06020503_nested_type_definition_for_field_types_001 { + + type union MyUnionType + { + record { + integer field1, + integer field2 optional + } option1, + record of integer option2, + union { + integer suboption1, + charstring suboption2 + } option3 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04c06ce2222ad039d11cf0602c276f1da2f336f7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values with two items + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The assignment notation shall be used for union-s, and the notation shall assign +// a value to one field only. This field becomes the chosen field. + +module NegSem_060205_top_level_001 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_001() runs on GeneralComp { + var U v_choice := { option1 := 1, option2 := "abc" }; + if (ischosen(v_choice.option1) or ischosen(v_choice.option2)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5bbb4d242c9db4d2fbfee5c8afc3f66e99484fce --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_002.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values with unknown alternative + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The assignment notation shall be used for union-s, and the notation shall assign +// a value to one field only. This field becomes the chosen field. + +module NegSem_060205_top_level_002 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_002() runs on GeneralComp { + var U v_choice := { option1 := 10 }; + v_choice := { option3 := true }; + if (ischosen(v_choice.option1)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e6ea874871a3fd71bc7fc523ba07fd73131a19d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, "not used" symbol in union value notations + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Neither the not used symbol "-" nor omit is allowed in union value notations. + +module NegSem_060205_top_level_003 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_003() runs on GeneralComp { + var U v_choice := { option1 := - }; + if (ischosen(v_choice.option1)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a314fd94404f576707974581401fa673fca2e87e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_004.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, omit symbol in union value notations + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Neither the not used symbol "-" nor omit is allowed in union value notations. + +module NegSem_060205_top_level_004 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_NegSem_060205_top_level_004() runs on GeneralComp { + var U v_choice := { option1 := omit }; + if (ischosen(v_choice.option1) or ischosen(v_choice.option2)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a81ce0f07a43576ec634ff730b070b8d26ee2b0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSem_060205_top_level_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, value list notation used for union value definition + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The value list notation shall not be used for setting values of union types. + +module NegSem_060205_top_level_005 { + type component GeneralComp { + } + + type union U { + integer option1 + } + + testcase TC_NegSem_060205_top_level_005() runs on GeneralComp { + var U v_choice := { 1 }; + if (ischosen(v_choice.option1)) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_NegSem_060205_top_level_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSyn_060205_top_level_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSyn_060205_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbd7091ddbcd157a3bd4beda8ea04d9d44960199 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/NegSyn_060205_top_level_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, union type declaration with two equal identifiers + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the union type. The union type is a collection of alternatives, +// each one identified by an identifier. Only one of the specified alternatives +// will ever be present in an actual union value. Union types are useful to model +// data which can take one of a finite number of known types. + +module NegSyn_060205_top_level_001 { + type union U { + integer option1, + charstring option2, + boolean option1 // error expected + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49c2ea496f904a814759bb75d90090f6bd560f02 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Sem_060205_top_level_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, assignment notation for union values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The assignment notation shall be used for union-s, and the notation shall assign +// a value to one field only. This field becomes the chosen field. + +module Sem_060205_top_level_001 { + type component GeneralComp { + } + + type union U { + integer option1, + charstring option2 + } + + testcase TC_Sem_060205_top_level_001() runs on GeneralComp { + var U v_choice := { option1 := 1 }; + if (ischosen(v_choice.option1) and v_choice.option1 == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + execute(TC_Sem_060205_top_level_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58eca5ff23732a5564bf3377e57d2c486cea82be --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, union type declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the union type. The union type is a collection of alternatives, +// each one identified by an identifier. Only one of the specified alternatives +// will ever be present in an actual union value. Union types are useful to model +// data which can take one of a finite number of known types. + +module Syn_060205_top_level_001 { + const integer number := 4; // to test rules on uniqueness of identifiers + + type union MyUnionType + { + integer number, + charstring string + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2df8fc98c0aab846ce65ab9e75a33c2ff8f978a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/060205_toplevel/Syn_060205_top_level_002.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.5, union type declaration with single item + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// TTCN-3 supports the union type. The union type is a collection of alternatives, +// each one identified by an identifier. Only one of the specified alternatives +// will ever be present in an actual union value. Union types are useful to model +// data which can take one of a finite number of known types. + +module Syn_060205_top_level_002 { + type union U { + integer option1 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3097d765588d5fd4d1d8620e5f92106ac0f037b2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that after redeclaration of an anytype value the old type and value are lost + ** @verdict pass reject + ***************************************************/ +module NegSem_060206_anytype_001 { + type component GeneralComp { + +var anytype Var1, Var2; + +} + +testcase TC_NegSem_060206_anytype_001() runs on GeneralComp { + +Var1.integer := 10; +Var2.float := 3.0E0; + +Var1.float := 5.5E0; +Var2.charstring := "abc"; // the new type of Var2 is charstring instead of float + + if ( match(Var1.integer, 10) and match(Var2.float, 3.0E0)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_NegSem_060206_anytype_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03d32423cb21304695de4c225ba07dc8780ca284 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSem_060206_anytype_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, Ensure that anytype can not be address type if not explicitly declareted in the module + ** @verdict pass reject + ***************************************************/ +module NegSem_060206_anytype_002 { + +type component GeneralComp { + + var anytype x; +} + + +testcase TC_NegSem_060206_anytype_002() runs on GeneralComp { + +x.address:=10; // error: address type is not declarated in the module explicitly + + + if (x.address==10) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_NegSem_060206_anytype_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6385af8ee3f4b703d517454a5b4b113572aca903 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can not be a default type + ** @verdict pass reject + ***************************************************/ + +module NegSyn_060206_anytype_001 { + +type default Mydef; + +type component GeneralComp { + var Mydef y:= null; + var anytype x; + +} + + +testcase TC_NegSyn_060206_anytype_001() runs on GeneralComp { + +x.Mydef := y; // default type is not allowed with anytype + + + + if (x.Mydef == null) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_NegSyn_060206_anytype_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2daf3fc3f21fc543b7bba2eae8fbb9abc2d6e309 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype cannot be port type + ** @verdict pass reject + ***************************************************/ + + +module NegSyn_060206_anytype_002 { + + +type port MyPort message{ + address integer; + inout integer; +}; + +type component GeneralComp { +var anytype x; +port MyPort PCO1; + +} + + +testcase TC_NegSyn_060206_anytype_002() runs on GeneralComp { + +x.MyPort:= PCO1; // port type is not allowed with anytype + + +} + +control { + execute(TC_NegSyn_060206_anytype_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19c11961f2e537d4bc47f19a22e9337a9565144a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/NegSyn_060206_anytype_003.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that component type not allowed for anytype + ** @verdict pass reject + ***************************************************/ + +module NegSyn_060206_anytype_003 { + +type component MyComp{ +var integer b; +} + +type component GeneralComp extends MyComp { + + var anytype c; + +} + + +testcase TC_NegSyn_060206_anytype_003() runs on GeneralComp { + +b := 10; + +c.MyComp:= b; // Component type is not allowed with anytype + + + +} + +control { + execute(TC_NegSyn_060206_anytype_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f5853a63d25901f4c5ca3b161a361522385a989 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype comprise integer data type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_001 { + + + type component GeneralComp { + +var anytype Var1, Var2; +var integer Var3; +} + + +testcase TC_Sem_060206_anytype_001() runs on GeneralComp { + +Var1.integer := 10; +Var2:= {integer := Var1.integer + 3}; +Var3 := Var2.integer * 2; + + if (Var3==26) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9674c76c255c211eb9dacea528a07f77f32dd147 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_002.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype comprise float data type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_002 { + type component GeneralComp { + +var anytype Var1, Var2; +var float Var3; + +} + +testcase TC_Sem_060206_anytype_002() runs on GeneralComp { + +Var1.float := 10.5; +Var2:= {float := Var1.float + 3.0}; +Var3 := Var2.float * 2.0; + + if (Var3==27.0) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d97f51034eee1bb191ef3a9131635aed4621560 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_003.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype comprise boolean data type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_003 { + type component GeneralComp { + +var anytype Var1, Var2,Var3; +var boolean Var4, Var5; + +} + +testcase TC_Sem_060206_anytype_003() runs on GeneralComp { + +Var1.boolean := true; +Var2.boolean:=true; +Var3.boolean := not Var1.boolean; // not true = false + +Var4 := Var1.boolean and Var2.boolean; // true and true = true +Var5 := Var1.boolean and Var3.boolean; // true and false = false + + if (match(Var4, true) and match(Var5, false)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..704dadd048fbd5ebe11d7c09cede844366400c28 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_004.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype comprise verdicttype data type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_004 { + type component GeneralComp { + +var anytype Var1, Var2; +var verdicttype c; + +} + +testcase TC_Sem_060206_anytype_004() runs on GeneralComp { + +Var1.verdicttype := pass; +Var2.verdicttype:=fail; + +c :=Var1.verdicttype; + + if (match(c, pass) and match(Var2.verdicttype, fail)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc17ade32c650368f45e9393a5a1221dafaeb44c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_005.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype comprise bitstring and hexstring data type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_005 { + type component GeneralComp { + +var anytype Var1, Var2; +} + +testcase TC_Sem_060206_anytype_005() runs on GeneralComp { + +Var1.bitstring := '1010'B; +Var2.hexstring:='FE80'H; + + + if (match(Var1.bitstring, '1010'B) and match(Var2.hexstring, 'FE80'H)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..357fde8c9f888fbe81fff238a2c2b8c0adcafd1a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that ensure that anytype comprise octetstring and charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_006 { + + type component GeneralComp { + +var anytype MyVarOne, MyVarTwo; +var octetstring MyVarThree; +var charstring MyString1; +} + +testcase TC_Sem_060206_anytype_006() runs on GeneralComp { + +MyVarOne.octetstring := 'FF70'O; //a float in anytype +MyVarTwo.charstring :="abc"; // a charstring in the same anytype + +MyVarThree:=MyVarOne.octetstring; +MyString1:=MyVarTwo.charstring&"def"; // "abc" & "def" =>"abcdef" + + if ( match(MyVarThree, 'FF70'O) and match(MyString1, "abcdef") ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2239d8af8bc24366c0f9c3d891153fca51ce0248 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_007.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that ensure that anytype comprise universal charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_007{ + + type component GeneralComp { + var anytype MyVarOne; + var universal charstring MyVarThree; + } + +testcase TC_Sem_060206_anytype_007() runs on GeneralComp { + + + MyVarOne.universal charstring := "FF80"; //a universal charstring in anytype + + MyVarThree:=MyVarOne.universal charstring; + + if (MyVarThree=="FF80") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_007()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c99a1f48091399f4bbd2f2e3fd58cde3f735e743 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_008.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype is a valid value inside an union + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_008 { + type component GeneralComp { + var anytype c; +} + +type union R + { + anytype cs1 //Union type R element is an anytype data + } + + +testcase TC_Sem_060206_anytype_008() runs on GeneralComp { + +c.R.cs1.charstring := "abc"; // The element of Uninon R becomes a charstring + + if (c.R.cs1.charstring =="abc") { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8e108a650c1e236efe4fa0d4408eed2e3bc0e18 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_009.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that record values can be anytype + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_009 { + + type record MyRec + { + anytype cs1 //Record type MyRec element is an anytype data + } + + type component GeneralComp { + var MyRec R; + var anytype c,d; +} + + + + +testcase TC_Sem_060206_anytype_009() runs on GeneralComp { + + +R.cs1.charstring:= "abc"; // cs1 in R record is now charstring +c.charstring :=R.cs1.charstring; // anytype c becomes a charstring + +R.cs1.integer:= 15; // cs1 in R record now integer +d.integer := R.cs1.integer; //anytype d becomes integer + + + if ( match(c.charstring, "abc") and match(d.integer, 15)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..933583d157c0fd342cfc9d09197f6f91907d470a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_010.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can be an enum type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_010 { + type component GeneralComp { +} + +type enumerated Myenum +{ +FirstElement, +SecondElement +} + +testcase TC_Sem_060206_anytype_010() runs on GeneralComp { + +var anytype c; +c.Myenum:= FirstElement; // anytype c follows the type Myenum and the value of c should be FirstElement + + if (c.Myenum ==FirstElement) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_010()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f3d7ffc03d1019beed693ea5b91318585cfd527 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_011.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can have an set value and set value can be anytype + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_011 { + type component GeneralComp { +} + +type set MySet +{ +integer First, +charstring Second, +anytype Third //3rd element of this type of set is anytype +} + +testcase TC_Sem_060206_anytype_011() runs on GeneralComp { + +var anytype c; +var MySet S; // Set S from type MySet + +c.MySet.Second := "abc"; // anytype c becomes a charstring +S.Third.float:=15.5; // The 3rd element in set S is now becomes a float with value 15.5 + + + if ( match(c.MySet.Second, "abc") and match(S.Third.float, 15.5)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_011()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ecbe987db713fd17df021a7d6caa897bc4e5c0e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_012.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that redeclaration of an anytype value works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_012 { + +type record R + { + anytype R1 // R Record type contains an anytype element. + }; + +type component GeneralComp { + +var anytype Var_1, Var_2,Var_3; +var R MyRec; + +} + +testcase TC_Sem_060206_anytype_012() runs on GeneralComp { + +Var_1.integer := 10; // Var_1 integer with value of 10 +Var_2.float := 3.0E0; // Var_2 float with value of 3.0 +MyRec.R1.float := 3.5E0; // record MyRec R1 element is now a float with value of 3.5 + +Var_3.float := MyRec.R1.float + Var_2.float; // Var_3 is float type = 3.5 + 3.0 + +// changing types: +Var_1.float := 5.5E0; // Var_1 float with value of 5.5 +Var_2.charstring := "abc"; // Var_2 charstring with value of "abc" +MyRec.R1.charstring := "def"; // record MyRec R1 element is now a charstring with value of "def" + + if (match(Var_1.float, 5.5E0) and match(Var_2.charstring, "abc") and match(Var_3.float, 6.5E0) + and match(MyRec.R1.charstring, "def")) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_012()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9df4f61ccd15d403b54e783737446ee6e187c54 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_013.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that address type is included to anytype (if it has been explicitly defined within that module) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_013 { + + +type integer address; // definition of address type globally + + +type component GeneralComp { + + var anytype x; +} + + +testcase TC_Sem_060206_anytype_013() runs on GeneralComp { + +x.address:=10; // anytype x now address type with value integer 10 + + + if (x.address==10) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_013()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3f8c9e235311076c91226a7a78577cf379cc5cd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_014.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can be record type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_014 { + +type record MyRec1{ + charstring field1, + boolean field2 }; + + +type component GeneralComp { + + var anytype x; // anytype x variable + + var MyRec1 y := { + field1:= "abc", + field2:= true }; // record y contains field1=abc and field2=true + +} + + +testcase TC_Sem_060206_anytype_014() runs on GeneralComp { + +x.MyRec1 := y; // anytype x now gets the type MyRec1 and the values given by y. + + + if (match(x.MyRec1.field1, "abc") and match(x.MyRec1.field2,true)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_014()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e00f6c58e0f7df567e3a6cf97d1e92abda9c7fe2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_015.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can act as a set type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_015 { + +type set MySet{ + charstring field1, + boolean field2 }; + + +type component GeneralComp { + + var anytype x; // anytype x variable + + var MySet y := { + field1:= "abc", + field2:= true }; // Set y contains field1=abc and field2=true + +} + + +testcase TC_Sem_060206_anytype_015() runs on GeneralComp { + +x.MySet := y; // anytype x now gets the type MySet and the values given by y. + + + if ( match(x.MySet.field1, "abc") and match(x.MySet.field2, true)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_015()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f67cc62e848ae11939bb9c6f8923ffd8ef1d3957 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_016.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can act as an union + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_016 { + +type union MyUnion1 { +integer number, +charstring string +}; + + +type component GeneralComp { + + var anytype x; // anytype x variable + var MyUnion1 y; + +} + + +testcase TC_Sem_060206_anytype_0016() runs on GeneralComp { + +y.number:=11; +y.string := "abc"; // Union y contains field1=abc and field2=true + + +x.MyUnion1:= y; // anytype x now gets the type MyUnion1 and the values given by y. + + if (valueof(x.MyUnion1)==valueof(y)) + { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_0016()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..baca72b0de1e2f0d8ec3979822b1fd487e52fcf2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_017.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can comprise array type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_017 { + +type integer MyArray[1..3]; // MyArray type is an integer array with 3 elements + + +type component GeneralComp { + + var anytype x; // Anytype x variable + var MyArray y := {1,2,4}; // y array follows type MyArray with values 1,2,4 + +} + + +testcase TC_Sem_060206_anytype_0017() runs on GeneralComp { + +x.MyArray := y; // anytype x now follows type MyArray and gets the values of 1,2,4 as given in array y. + + + if (match(x.MyArray, {1,2,4})) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_0017()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_018.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bde4be587b3ce59d18b5638d6a43617bca628c6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_018.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype can comprise set of and record of types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060206_anytype_018 { + +type record of integer FirstRecordOf; // record of integers +type set of boolean FirstSetOf; // set of booleans + + +type component GeneralComp { + + var anytype x; // Anytype x and y variables + var anytype y; + + var FirstRecordOf MyVar1 := { 0, 5, 2, -, 6 }; // MyVar1 follows type FirstRecordOf with values 0,5,2,-,6 + var FirstSetOf MyVar2 := { true, -,-, false, true}; // MyVar2 follows type FirstSetOf with values true,-,-,false,true + +} + + +testcase TC_Sem_060206_anytype_0018() runs on GeneralComp { + +x.FirstRecordOf := MyVar1; // anytype x is now a record of type with values of MyVar1 +y.FirstSetOf := MyVar2; // anytype x is now a set of type with values of MyVar2 + + if (match(x.FirstRecordOf[0], 0) and match(x.FirstRecordOf[4], 6) + and match(y.FirstSetOf[0], true) and match(y.FirstSetOf[3], false) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_0018()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_019.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a350a53a5192b50cea19c7cde330a94af330c70 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060206_anytype/Sem_060206_anytype_019.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.0.6, ensure that anytype (as a user defined type) can be imported from another module + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060206_anytype_019 { +import from Sem_060206_anytype_019_import all; // this contains a type (anytype) MyAnyType + +type component GeneralComp { +var MyAnyType x; // MyAnyType is an anytype defined in module Sem_060206_anytype_017_import +var MyAnyType y; +} + + +testcase TC_Sem_060206_anytype_019() runs on GeneralComp { + +x.float := 10.0E0; //anytype x is now a float with value 10.0 +y.bitstring := '1010'B; //anytype y is now a bitstring with value 1010 + + if (match(x.float, 10.0E0) and match(y.bitstring, '1010'B)) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060206_anytype_019()); +} + +} + + +module Sem_060206_anytype_019_import +{ + + type anytype MyAnyType; + + + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96adc6dacd554e0944b574c64f3add0b4dfd0233 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that the value limitation is correctly handled within array + ** @verdict pass reject + ***************************************************/ +module NegSem_060207_arrays_001 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + +testcase TC_NegSem_060207_arrays_001() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 11, 2, 3, 4}; // syntax error expected, value shall be between 1..10 + +} + +control { + execute(TC_NegSem_060207_arrays_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b8665b42a99b3dd0b5214ec315acfa1227328ed --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that the inner type referencing is correctly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_060207_arrays_002 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + +testcase TC_NegSem_060207_arrays_002() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4, 5, 6}; // array is longer than the restricted length + +} + +control { + execute(TC_NegSem_060207_arrays_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98426ffeb22bb2faf487659c5c1d0b48633e5df6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_003.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, negative index applied to an array on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module NegSem_060207_arrays_003 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_003() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + var integer i := v_array1[-1]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_003()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fb2149573f71fa0be8774332c2425a78c057b40 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_004.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, negative index applied to an array on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module NegSem_060207_arrays_004 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_004() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + v_array1[-1] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_004()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c702a41a62c01446e9fb77db870c5372b0e1b20 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, wrong index type applied to an array on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. +// [from 3.1] index notation: notation to access individual elements of record of, +// set of, array and string values or templates, where the element to be accessed +// is identified explicitly by an index value enclosed in square brackets ("[" and +// "]") which specifies the position of that element within the referenced value +// or template and the index value is either an integer value, array of integers +// or record of integers. + +module NegSem_060207_arrays_005 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_005() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + var integer i := v_array1["0"]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb8f57db4ff80251a85ecbb01016fa96017ef459 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, wrong index type applied to an array on the left hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. +// [from 3.1] index notation: notation to access individual elements of record of, +// set of, array and string values or templates, where the element to be accessed +// is identified explicitly by an index value enclosed in square brackets ("[" and +// "]") which specifies the position of that element within the referenced value +// or template and the index value is either an integer value, array of integers +// or record of integers. + +module NegSem_060207_arrays_006 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_006() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + v_array1["0"] := 10; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_006()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eac13e71c0a80d5b6b7f12619447b67b27dc654b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_007.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, array index greater than the upper bound (left-hand side) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index shall not exceed the limitations given by either the length or the +// upper bound of the index. + +module NegSem_060207_arrays_007 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_007() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + v_array1[5] := 3; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_007()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14a4da4b76717b1a3004ecc396dbffda21d5b596 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_008.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, wrong index type applied to an array on the right hand side of an assignment + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index shall not exceed the limitations given by either the length or the +// upper bound of the index. + +module NegSem_060207_arrays_008 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSem_060207_arrays_008() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4}; + var integer i := v_array1[5]; // error expected + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_008()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a650942cfd465d958837642efd118a3a02893c75 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_009.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify than an error is generated when sending a partially initialized array + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Sending an array value with undefined elements shall cause an error. + +module NegSem_060207_arrays_009 { + + type integer MyArrayType1[5] (1 .. 10); + + type port P message { + inout MyArrayType1 + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_060207_arrays_009() runs on GeneralComp { + var template MyArrayType1 m_array1 := { 8, 9, -, 3, 4}; + p.send(m_array1); // error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_060207_arrays_009()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f1daa5bbd4a5bbe43eba352d37cdb3063f8ff84 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_010.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that the value limitation is correctly handled within array + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The values of array elements shall be compatible with the corresponding +// variable or type declaration. + +module NegSem_060207_arrays_010 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + +testcase TC_NegSem_060207_arrays_010() runs on GeneralComp { + + var MyArrayType1 v_array1 := { + [0] := 8, + [1] := 0,// error expected, value shall be between 1..10 + [2] := 2, + [2] := 3, + [2] := 4 + }; + +} + +control { + execute(TC_NegSem_060207_arrays_010()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72c1e2f4f7ef16c5f40a9dcad2de124441772c0f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_011.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, runtime resolved constant in array type declaration + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_011 { + + type component GeneralComp { + } + + function f() return integer { + if (rnd() < 0.5) { return 5; } + else { return 10; } + } + + const integer c_dimension := f(); + type integer Arr[c_dimension]; + + testcase TC_NegSem_060207_arrays_011() runs on GeneralComp { + var Arr v_arr; + v_arr[0] := 1; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_011()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2629456b7154ecce48d118bcc5fab016288419d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_012.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, runtime resolved constant in array variable declaration + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_012 { + + type component GeneralComp { + } + + function f() return integer { + if (rnd() < 0.5) { return 5; } + else { return 10; } + } + + const integer c_dimension := f(); + + testcase TC_NegSem_060207_arrays_012() runs on GeneralComp { + var integer v_arr[c_dimension]; + v_arr[0] := 1; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3c3d28a19552963958103556e9c9cd066d27262 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_013.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, variable in array variable declaration + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_013 { + + type component GeneralComp { + } + + function f() return integer { + if (rnd() < 0.5) { return 5; } + else { return 10; } + } + + testcase TC_NegSem_060207_arrays_013() runs on GeneralComp { + var integer v_dimension := f(); + var integer v_arr[v_dimension]; + v_arr[0] := 1; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_013()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38ab3d10e28512787582b228f12c3346c40c99df --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_014.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, modulepar in array variable declaration + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_014 { + + type component GeneralComp { + } + + function f() return integer { + if (rnd() < 0.5) { return 5; } + else { return 10; } + } + + modulepar integer PX_DIMENSION := 5; + + testcase TC_NegSem_060207_arrays_014() runs on GeneralComp { + var integer v_arr[PX_DIMENSION]; + v_arr[0] := 1; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_014()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34ce6065c3cec043d44e523b1addba80ef011571 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_015.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, zero dimension array + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_015 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_015() runs on GeneralComp { + var integer v_arr[0] := {}; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_015()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..431e84f34ae1c185560529f04c12615ca6c51412 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_016.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, array with negative dimension + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_016 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_016() runs on GeneralComp { + var integer v_arr[3][-1]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb44e123fc8e39afc6fe02e4c63950ea2083ebf4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_017.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, zero in array dimension (range notation) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_017 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_017() runs on GeneralComp { + var integer v_arr[0..2] := { 2, 3, 4 }; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_018.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b03475bb6555c4ac67f0d76d21ac5e318e4ded6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_018.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, negative value in array dimension (range notation) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_018 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_018() runs on GeneralComp { + const integer c_lower := 2 - 4; + var integer v_arr[c_lower .. 1]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_018()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_019.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3a97280b4acb496941943c9165630339f98f491 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_019.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, float instead of integer in array dimension + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module NegSem_060207_arrays_019 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_019() runs on GeneralComp { + var integer v_arr[2.0]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_019()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_020.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6713cce0c86ae5b0ee9d8ba52d2cae4f48484d5a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_020.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, integer array with too many items as multidimensional array index + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An array or record of integer restricted to a single size can be used in the +// index notation as a short-hand for the repeated index notation. + +module NegSem_060207_arrays_020 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_020() runs on GeneralComp { + var integer v_rhindexes[3] := { 0, 1, 0 }, v_lhindexes[3] := { 1, 2, 0 } + var integer v_arr[2][3] := { { 1, 2, 3 }, { 4, 5, 6 } }; + // testing both RH and LH side: + v_arr[v_lhindexes] := v_arr[v_rhindexes]; + if (v_arr == { { 1, 2, 3 }, { 4, 5, 2} }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_060207_arrays_020()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_021.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4da2e2cc220b1e64c46e8d053b85bec5a1f3d33c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_021.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, variable-size record of integer as multidimensional array index + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An array or record of integer restricted to a single size can be used in the +// index notation as a short-hand for the repeated index notation. + +module NegSem_060207_arrays_021 { + + type component GeneralComp { + } + + type record length(1..2) of integer RI; + + testcase TC_NegSem_060207_arrays_021() runs on GeneralComp { + var RI v_rhindexes := { 0, 1 }, v_lhindexes := { 1, 2 } + var integer v_arr[2][3] := { { 1, 2, 3 }, { 4, 5, 6 } }; + // testing both RH and LH side: + v_arr[v_lhindexes] := v_arr[v_rhindexes]; + if (v_arr == { { 1, 2, 3 }, { 4, 5, 2} }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_060207_arrays_021()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_022.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..572d2cdb98d2cc9fa60e343024119cddc425663a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_022.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using lower than allowed custom array index on the right hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module NegSem_060207_arrays_022 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_022() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + var boolean v_bool := v_arr[0] == 0; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_022()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_023.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..877bffdec80c3a15c43d1a10cc7bfa78c7b3d7a7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_023.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using lower than allowed custom array index on the left hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module NegSem_060207_arrays_023 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_023() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + v_arr[0] := 0; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_023()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_024.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae97a1368ed5c703a24b6372a26eef5984978c9c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_024.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using greater than allowed custom array index on the right hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index shall not exceed the limitations given by either the length or the +// upper bound of the index. + +module NegSem_060207_arrays_024 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_024() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + var boolean v_bool := v_arr[6] == 6; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_024()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_025.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..836eb4e8647f391b982721c18e3bc945c9d33ed0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_025.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using greater than allowed custom array index on the left hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The index shall not exceed the limitations given by either the length or the +// upper bound of the index. + +module NegSem_060207_arrays_025 { + + type component GeneralComp { + } + + testcase TC_NegSem_060207_arrays_025() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + v_arr[6] := 6; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_025()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_026.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85abd5ffcbc9c7e1c0a9982be40b5fa06f81e2bc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_026.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, referencing uninitialized array element on the right hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// : If the value of the element indicated by the index at the right hand of +// an assignment is undefined or if the index notation is applied to an uninitialized +// or omitted array value on the right hand side of an assignment, error shall be +// caused. + +module NegSem_060207_arrays_026 { + + type component GeneralComp { + } + + type record R { + integer field1[3], + boolean field2 + } + + testcase TC_NegSem_060207_arrays_026() runs on GeneralComp { + var integer v_arr[3], v_int; + v_arr[2] := 1; + v_int := v_arr[0]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_026()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_027.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a754dd9d4e61ad1295c723ebffb51b737312aa69 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_027.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, referencing element of uninitialized arrays on the right hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// : If the value of the element indicated by the index at the right hand of +// an assignment is undefined or if the index notation is applied to an uninitialized +// or omitted array value on the right hand side of an assignment, error shall be +// caused. + +module NegSem_060207_arrays_027 { + + type component GeneralComp { + } + + type record R { + integer field1[3], + boolean field2 + } + + testcase TC_NegSem_060207_arrays_027() runs on GeneralComp { + var R v_rec := { -, true } + var integer v_int := v_rec.field1[0]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_027()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_028.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57cea11291cc4d00fd3891b18bf966e331a1865d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSem_060207_arrays_028.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, referencing element of omitted arrays on the right hand side of assignments + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// : If the value of the element indicated by the index at the right hand of +// an assignment is undefined or if the index notation is applied to an uninitialized +// or omitted array value on the right hand side of an assignment, error shall be +// caused. + +module NegSem_060207_arrays_028 { + + type component GeneralComp { + } + + type record R { + integer field1[3] optional, + boolean field2 + } + + testcase TC_NegSem_060207_arrays_028() runs on GeneralComp { + var R v_rec := { omit, true } + var integer v_int := v_rec.field1[0]; + setverdict(pass); + } + + control { + execute(TC_NegSem_060207_arrays_028()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79ef24ced2e0ac467bc9ff92f8541ced8849917f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that array cannot contain an empty assignment + ** @verdict pass reject + ***************************************************/ + +module NegSyn_060207_arrays_001 { + + type component GeneralComp { + } + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSyn_060207_arrays_001() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, , 2, 3, 4}; // syntax error expected + + } + + control { + execute(TC_NegSyn_060207_arrays_001()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8227f1b04600b1e1332f3a2bc90faa6c1fd6826 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that array field cannot contain an empty index + ** @verdict pass reject + ***************************************************/ +module NegSyn_060207_arrays_002 { + + type component GeneralComp { + } + + + type integer MyArrayType1[5] (1 .. 10); + + testcase TC_NegSyn_060207_arrays_002() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 10, 2, 3, 4}; + v_array1[] := 10; // error expected - missing index + } + + control { + execute(TC_NegSyn_060207_arrays_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6de123d2310069d5d5a5529413dd1d043d7a1a46 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that array field cannot contain an empty index + ** @verdict pass reject + ***************************************************/ +module NegSyn_060207_arrays_002 { + + type component GeneralComp { + } + + + type integer MyArrayType1[5] (1 .. 10); + + + testcase TC_NegSyn_060207_arrays_002() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 10, 2, 3, 4}; + var integer i :=v_array1[];// error expected - missing index + } + + control { + execute(TC_NegSyn_060207_arrays_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57ba67905a09851688a65339e4b51be6fbab713c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_004.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, infinity in array variable dimension + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Array dimensions may also be specified using ranges (with inclusive +// boundaries only). In such cases, the lower and upper values of the range +// define the lower and upper index values. Such an array is corresponding to +// a record of with a fixed length restriction computed as the difference +// between upper and lower index bound plus 1 and indexing starting from the +// lower bound of the array definition. + +module NegSyn_060207_arrays_004 { + + control { + var integer v_arr[1..infinity]; + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1c18ec2cc5ac1fc2ccd27611fda649491f6e623 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/NegSyn_060207_arrays_005.ttcn @@ -0,0 +1,15 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.7, Ensur that arrays upper value shall not be lesser than the corresponding lower value + ** @verdict pass reject + ***************************************************/ +/*The following requirement is tested: + * The upper value shall not be lesser than the corresponding lower value. + */ +module NegSyn_060207_arrays_005 { + + control { + var integer v_arr[5..1]; // error: . The upper value shall not be lesser than the corresponding lower value + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..188d487a8eeae12c56180222111cc4980f72e2c2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify that value list notation can be used for an array + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060207_arrays_001 { + +// The following requirement is tested: +// When the value list notation is used, the first value of the list is assigned to +// the first element of the array (the element with index 0 or the lower bound if +// an index range has been given), the second value to the next element, etc. + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + +testcase TC_Sem_060207_arrays_001() runs on GeneralComp { + + var MyArrayType1 v_array1 := { 8, 1, 2 }; + if (v_array1[2]==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060207_arrays_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da43c9b83437c91c5cc063d26ad0c8a5a3b78920 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_002.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify assignment of explicitly identified elements to arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Values may be assigned individually by a value list notation or indexed notation +// or more than one or all at once by a value list notation or index assignment +// notation. +// Elements to be left out from the assignment shall be explicitly skipped in the +// list by using dash. + +module Sem_060207_arrays_002 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_002() runs on GeneralComp { + + var MyArrayType1 v_array1 := { + [0] := 8, + [1] := 1, + [2] := - + }; + + if (match(v_array1[0], 8) and match(v_array1[1], 1) and not isbound(v_array1[2]) + and lengthof (v_array1 & {2}) == 4) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ded539e9c7a373098fc9c14ce599424a7f91e4c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_003.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify handling of missing elements in assignment notation for arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For using the assignment notation for arrays, the rules described in 6.2.3 are +// valid for arrays as well. + +module Sem_060207_arrays_003 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_003() runs on GeneralComp { + + var MyArrayType1 v_array1 := { + [1] := 1 + }; + + if (not isbound(v_array1[0]) and match(v_array1[1], 1)) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_060207_arrays_003()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb413eb1a4327802035a72bd1d409e394627fb84 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_004.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify handling of missing and ignored elements during an array re-assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements to be left out from the assignment shall be explicitly skipped in the +// list by using dash. + +module Sem_060207_arrays_004 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_004() runs on GeneralComp { + + var MyArrayType1 v_array1 := { + [0] := 8, + [1] := -, + [2] := 2 + } + + v_array1[1] := 1; + + if (v_array1 == { 8, 1, 2 }) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060207_arrays_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f3021a79cebc09dfe47b055a5b79f2409f37840 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_005.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify handling of value list assignment used for initialization of arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Elements to be left out from the assignment shall be explicitly skipped in the +// list by using dash. + +module Sem_060207_arrays_005 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_005() runs on GeneralComp { + var MyArrayType1 v_array1 := {8, -, 2} + if (match(v_array1[0], 8) and match(v_array1[2], 2) and not isbound(v_array1[1]) + and lengthof (v_array1 & {2}) == 4) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5063f8c21c44150517ed7d49d6911500cc139e7c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_006.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.4, verify handling of value list assignment used for update of arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When the value list notation is used, the first value of the list is assigned to +// the first element of the array (the element with index 0 or the lower bound if +// an index range has been given), the second value to the next element, etc. + +module Sem_060207_arrays_006 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_006() runs on GeneralComp { + + var MyArrayType1 v_array1 := {8, -, 2} + v_array1 := {8, 1, 2}; + if (v_array1 == { 8, 1, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_006()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fff1a46af4c2a56a742ece9f6833fe9392df7e7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_007.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify handling of index notation applied to array on right-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand side +// of assignments. The index of the first element shall be zero or the lower bound +// if an index range has been given. + +module Sem_060207_arrays_007 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_007() runs on GeneralComp { + + var MyArrayType1 v_array1 := {8, 1, 2} + var integer i := v_array1[1]; + if (i == 1 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_007()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e0c89742d544ff138e2037ae703da849334df070 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_008.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify handling of index notation applied to array on left-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Indexed value notation can be used on both the right-hand side and left-hand side +// of assignments. The index of the first element shall be zero or the lower bound +// if an index range has been given. + +module Sem_060207_arrays_008 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_008() runs on GeneralComp { + + var MyArrayType1 v_array1 := {8, 1, 2} + v_array1[1] := 10; + if (v_array1 == { 8, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_008()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35952ee0ebc18deb3af77bdb5ae207145d9db28b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_009.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.3.2, verify the first element of an array is accessible by an index notation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The index of the first element shall be zero. +module Sem_060207_arrays_009 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_009() runs on GeneralComp { + + var MyArrayType1 v_array1 := {10, 1, 2}; + v_array1[0] := 10; // first index on the left hand side + v_array1[1] := v_array1[0]; // first index on the right hand side + if (v_array1 == { 10, 10, 2} ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_009()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19638447357de45f22a0f71b61730c7f8fb7cdd2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_010.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, verify that arrays can be used to specify record of type and they are compatible + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Arrays can be used in TTCN-3 as a shorthand notation to specify record of types. + +module Sem_060207_arrays_010 { + + type component GeneralComp { + } + + type integer MyArrayType1[3]; + type record length (3) of integer MyRecordOfType1; + + testcase TC_Sem_060207_arrays_010() runs on GeneralComp { + + var MyArrayType1 a1 := {7, 8, 9}; + var MyRecordOfType1 r1 := {7, 8, 9}; + + if (r1 == a1) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_010()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c06656d7feef243bdf60c75419b98f9d77608cb5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_011.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, index notation applied to omitted array field on left hand side of assignment + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// All elements in an array value that are not set explicitly are undefined. +// When referencing an element of an uninitialized array value or field or +// omitted field on the left hand side of an assignment, the rules for record +// of values specified in 6.2.3 apply. + +module Sem_060207_arrays_011 { + + type component GeneralComp { + } + + type record R { + integer field1[3] optional + } + + testcase TC_Sem_060207_arrays_011() runs on GeneralComp { + + var R v_rec := { field1 := omit }; + v_rec.field1[2] := 3; + + if (not isbound(v_rec.field1[0]) and not isbound(v_rec.field1[1]) and + v_rec.field1[2] == 3) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_011()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27c2cc1074b08ddbafc4692a5915a2d0880d6308 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_012.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, referencing element of uninitialized array (left-hand side) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// All elements in an array value that are not set explicitly are undefined. When +// referencing an element of an uninitialized array value or field or omitted field +// on the left hand side of an assignment, the rules for record of values specified +// in 6.2.3 apply. + +module Sem_060207_arrays_012 { + + type component GeneralComp { + } + + type integer MyArrayType1[3] (1 .. 10); + + testcase TC_Sem_060207_arrays_012() runs on GeneralComp { + + var MyArrayType1 v_array1; + v_array1[2] := 2; // {-, -, 2} + if (not isbound(v_array1[0]) and + not isbound(v_array1[1]) and + match(v_array1[2], 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060207_arrays_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d036c3aae8cc077f21b3cb8d4b51e5111dde409 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_013.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.7, ensure that the two dimensional array type referencing is correctly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060207_arrays_013 { + +// The following requirement is tested: +// Individual elements of multi-dimensional arrays can be accessed by repeated use of +// the index notation. +// For assigning values to multi-dimensional arrays, each dimension that is assigned +// shall resolve to a set of values enclosed in curly braces. + + type component GeneralComp { + } + + + type integer MyArrayType1[2][3] (1 .. 10); + + +testcase TC_Sem_060207_arrays_013() runs on GeneralComp { + + var MyArrayType1 v_array1 := {{8, 10, 9}, + {2, 3, 4}}; + + if (v_array1[1][1]==3) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060207_arrays_013()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..902bd044e3e2934719cf6edd68848a1dd3664a64 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_014.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:6.2.7, verify assignment of explicitly identified elements to two dimensional array + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When specifying values for multi-dimensional arrays, the leftmost dimension +// corresponds to the outermost structure of the value, and the rightmost dimension to +// the innermost structure. + +module Sem_060207_arrays_014 { + + type component GeneralComp { + } + + + type integer MyArrayType1[2][3] (1 .. 10); + + +testcase TC_Sem_060207_arrays_014() runs on GeneralComp { + + var MyArrayType1 v_array1; + v_array1[0][0] := 8; + v_array1[0][1] := 10; + v_array1[0][2] := 9; + v_array1[1][0] := 2; + v_array1[1][1] := 3; + //v_array1[1][2] := -; // NOT ALLOWED!!! + + if (match(v_array1[0][0], 8) and match(v_array1[1][0], 2) and not isbound(v_array1[1][2]) + and match(lengthof (v_array1), 2) and match(lengthof (v_array1[0]), 3)) + { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_060207_arrays_014()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_015.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ee7bf07f9044400ff814517a430d5a53305f704 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_015.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, constant expression in array dimension + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module Sem_060207_arrays_015 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_015() runs on GeneralComp { + var integer v_arr[9 - 3 * 2] := { 0, 1, 2 }; + setverdict(pass); + } + + control { + execute(TC_Sem_060207_arrays_015()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_016.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4c62a6153cc102e91b25dcd6e39393b13e38764 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_016.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, predefined function in array dimension + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Array dimensions shall be specified using constant expressions, which shall +// evaluate to a positive integer values. Constants used in the constant +// expressions shall meet with the restrictions in clause 10. + +module Sem_060207_arrays_016 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_016() runs on GeneralComp { + var integer v_arr[float2int(3.14159265359)] := { 0, 1, 2}; + log(v_arr); + setverdict(pass); + } + + control { + execute(TC_Sem_060207_arrays_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_017.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..afbaf1c77e4c008e7e246ac65ae129e75d6b3e18 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_017.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, integer array as multidimensional array index + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An array or record of integer restricted to a single size can be used in the +// index notation as a short-hand for the repeated index notation. + +module Sem_060207_arrays_017 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_017() runs on GeneralComp { + var integer v_rhindexes[2] := { 0, 1 }, v_lhindexes[2] := { 1, 2 } + var integer v_arr[2][3] := { { 1, 2, 3 }, { 4, 5, 6 } }; + // testing both RH and LH side: + v_arr[v_lhindexes] := v_arr[v_rhindexes]; + if (v_arr == { { 1, 2, 3 }, { 4, 5, 2} }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_018.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..587dee7eb9e14b2bc6d89b8603163a7ea6b8d261 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_018.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, fixed-size record of integer as multidimensional array index + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An array or record of integer restricted to a single size can be used in the +// index notation as a short-hand for the repeated index notation. + +module Sem_060207_arrays_018 { + + type component GeneralComp { + } + + type record length(2) of integer RI; + + testcase TC_Sem_060207_arrays_018() runs on GeneralComp { + var RI v_rhindexes := { 0, 1 }, v_lhindexes := { 1, 2 } + var integer v_arr[2][3] := { { 1, 2, 3 }, { 4, 5, 6 } }; + // testing both RH and LH side: + v_arr[v_lhindexes] := v_arr[v_rhindexes]; + if (v_arr == { { 1, 2, 3 }, { 4, 5, 2} }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_018()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_019.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d34986cd32f7657c1b8fbd8871038c5d4c5f689b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_019.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, integer array as multidimensional array index (less items than dimension count) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An array or record of integer restricted to a single size can be used in the +// index notation as a short-hand for the repeated index notation. + +module Sem_060207_arrays_019 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_019() runs on GeneralComp { + var integer v_rhindexes[2] := { 0, 1 }, v_lhindexes[2] := { 1, 0 } + var integer v_arr[2][2][3] := { { { 1, 2, 3 }, { 4, 5, 6 } }, { { 7, 8, 9 }, { 10, 11, 12 } } }; + // testing both RH and LH side: + v_arr[v_lhindexes] := v_arr[v_rhindexes]; + if (v_arr == { { { 1, 2, 3 }, { 4, 5, 6 } }, { { 4, 5, 6 }, { 10, 11, 12 } } }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_019()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_020.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4727ed140f2cedca92259dd83b79ebf073b5b8e2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_020.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using custom array index on the right hand side of assignments + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module Sem_060207_arrays_020 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_020() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + if (v_arr[2] == 2) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_020()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_021.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d691d85c3b805443e6eba13246d8067f4e27395 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_021.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using custom array index on the left hand side of assignments + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Indexed value notation can be used on both the right-hand side and left-hand +// side of assignments. The index of the first element shall be zero or the lower +// bound if an index range has been given. + +module Sem_060207_arrays_021 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_021() runs on GeneralComp { + var integer v_arr[2..5] := { 2, 3, 4, 5 }; + v_arr[2] := 200; + if (v_arr == { 200, 3, 4, 5 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_021()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_022.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1610415b807f13ca348de4a797e1b1cd6083da8e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_022.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using less indexes than array dimensions on the right hand side of assignments + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The use of array slices of multi-dimensional arrays, i.e. when the number of +// indexes of the array value is less than the number of dimensions in the +// corresponding array definition, is allowed. Indexes of array slices shall +// correspond to the dimensions of the array definition from left to right (i.e. +// the first index of the slice corresponds to the first dimension of the definition). +// Slice indexes shall conform to the related array definition dimensions. + +module Sem_060207_arrays_022 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_022() runs on GeneralComp { + var integer v_arr[2][2][3] := { { { 1, 2, 3 }, { 4, 5, 6 } }, { { 7, 8, 9 }, { 10, 11, 12 } } }; + if (v_arr[0][1] == { 4, 5, 6 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_022()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_023.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62faa24aba552873635dd75fffeeec3a4a540302 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Sem_060207_arrays_023.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, using less indexes than array dimensions on the left hand side of assignments + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The use of array slices of multi-dimensional arrays, i.e. when the number of +// indexes of the array value is less than the number of dimensions in the +// corresponding array definition, is allowed. Indexes of array slices shall +// correspond to the dimensions of the array definition from left to right (i.e. +// the first index of the slice corresponds to the first dimension of the definition). +// Slice indexes shall conform to the related array definition dimensions. + +module Sem_060207_arrays_023 { + + type component GeneralComp { + } + + testcase TC_Sem_060207_arrays_023() runs on GeneralComp { + var integer v_arr[2][2][3] := { { { 1, 2, 3 }, { 4, 5, 6 } }, { { 7, 8, 9 }, { 10, 11, 12 } } }; + v_arr[0][1] := { 400, 500, 600 }; + if (v_arr == { { { 1, 2, 3 }, { 400, 500, 600 } }, { { 7, 8, 9 }, { 10, 11, 12 } } }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_060207_arrays_023()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..922819a9939fe2d9106524791a393a24cd1accd9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, array specified in variable declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// They [arrays] may be specified also at the point of a variable declaration. + +module Syn_060207_arrays_001 { + + const integer c_arr[2] := {0, 1}; + modulepar integer PX_ARR[3]; + + control { + var integer v_arr[5], v_noarr, v_arr2[2]; + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c517f231115773c49e93c70315589cfd3ae36313 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_002.ttcn @@ -0,0 +1,15 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, multidimensional array type declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Arrays may be declared as single or multi-dimensional. + +module Syn_060207_arrays_002 { + + type integer MultiArray[3][4][2][5]; + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16e62f0a440d96d723e645864caa1bf5caa840a1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_003.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, multidimensional array specified in variable declaration + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Arrays may be declared as single or multi-dimensional. + +module Syn_060207_arrays_003 { + + const integer c_arr[2][3] := { { 0, 1, 2}, {3, 4, 5 }}; + modulepar integer PX_ARR[3][2][6]; + + control { + var integer v_arr[5][3], v_noarr, v_arr2[2][2][10]; + } + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..63b4df96f6f8e4883c9f515d61a5a3a54e4a041e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_004.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, array type dimension specified as a range + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Array dimensions may also be specified using ranges (with inclusive +// boundaries only). In such cases, the lower and upper values of the range +// define the lower and upper index values. Such an array is corresponding to +// a record of with a fixed length restriction computed as the difference +// between upper and lower index bound plus 1 and indexing starting from the +// lower bound of the array definition. + +module Syn_060207_arrays_004 { + + type integer Arr[1..5]; + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..654d45d2d8650b65ca5a1aafec4a47ad6aa811a0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_005.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, multiple array type dimensions specified as a range + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Array dimensions may also be specified using ranges (with inclusive +// boundaries only). In such cases, the lower and upper values of the range +// define the lower and upper index values. Such an array is corresponding to +// a record of with a fixed length restriction computed as the difference +// between upper and lower index bound plus 1 and indexing starting from the +// lower bound of the array definition. + +module Syn_060207_arrays_005 { + + type integer Arr[1..3][5][6 - 4 .. 2 * 3]; + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5294fa3879d8a9127cf51a70a7e63193e98d6a1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_006.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, array variable dimension specified as a range + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Array dimensions may also be specified using ranges (with inclusive +// boundaries only). In such cases, the lower and upper values of the range +// define the lower and upper index values. Such an array is corresponding to +// a record of with a fixed length restriction computed as the difference +// between upper and lower index bound plus 1 and indexing starting from the +// lower bound of the array definition. + +module Syn_060207_arrays_006 { + + control { + var integer v_arr[1..3]; + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..669eb53306a1b88afba716dff2905bc1c097269c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060207_arrays/Syn_060207_arrays_007.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.7, multiple array variable dimensions specified as a range + ** @verdict pass accept, noexecution + ***************************************************/ + +// The following requirement is tested: +// Array dimensions may also be specified using ranges (with inclusive +// boundaries only). In such cases, the lower and upper values of the range +// define the lower and upper index values. Such an array is corresponding to +// a record of with a fixed length restriction computed as the difference +// between upper and lower index bound plus 1 and indexing starting from the +// lower bound of the array definition. + +module Syn_060207_arrays_007 { + + control { + var integer v_arr[1..3][2][6 - 4 .. 2 * 3]; + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/NOTES b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..46d582a35edfc20f8635a20c93cf29aa859cda7a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/NOTES @@ -0,0 +1,25 @@ +There are no tests for the following rules: + +1. +Default references are used in deactivate operations (see clause 20.5.3) in order to +identify the default to be deactivated. + +Reason: No reason for a dedicated test, tested in 20.5.3. + +2. +Default references have meaning only within the test component instances they are +activated, i.e. a default reference assigned to a default variable in test component +instance "a1" of type "A" has no meaning in test component instance "a2" of type "A". + +Reason: No meaningful test for the rule. The most common way to use defaults is +deactivate operation specified in 20.5.3 which contains a dedicated test related +to this requirement. + +3. +The actual data representation of the default type shall be resolved externally by the +test system. This allows abstract test cases to be specified independently of any real +TTCN-3 runtime environment, in other words TTCN-3 does not restrict the implementation +of a test system with respect to the handling and identification of defaults. + +Reason: This rule is only declaratory and doesn't set any binding requirements which +could be verified. diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b8d12348c23156fa9ccb20329402112e81e288d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.8, verify than a reference to an activated default can be assigned to a default variable + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Default references are unique references to activated defaults. Such a unique +// default reference is generated by a test component when an altstep is activated +// as a default, i.e. a default reference is the result of an activate operation. + +module Sem_060208_default_type_001 { + + type component GeneralComp { + } + + altstep a() runs on GeneralComp + { + [] any port.receive {} + } + + testcase TC_Sem_060208_default_type_001() runs on GeneralComp { + var default v_default := activate(a()); + if (v_default != null) { setverdict(pass) } + else { setverdict(fail) } + } + + control{ + execute(TC_Sem_060208_default_type_001()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b2821a1616915be7be62094dd8348ba24e55ff4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.8, verify than null value can be assigned to a default variable + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The special value null represents an unspecific default reference, e.g. can be +// used for the initialization of variables of default type. + +module Sem_060208_default_type_002 { + + type component GeneralComp { + } + + testcase TC_Sem_060208_default_type_002() runs on GeneralComp { + var default v_default := null; + if (isbound(v_default)) { setverdict(pass) } + else { setverdict(fail) } + } + + control{ + execute(TC_Sem_060208_default_type_002()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31016f2d5070b33d5f3aa80e1c58f2ea4cb34961 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060208_default_type/Sem_060208_default_type_003.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.8, verify than existing default references can be assigned + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Default references have the special and predefined type default. +// + general type compatibility rules + +module Sem_060208_default_type_003 { + + type component GeneralComp { + } + + altstep a() runs on GeneralComp + { + [] any port.receive {} + } + + testcase TC_Sem_060208_default_type_001() runs on GeneralComp { + var default v_default := activate(a()), v_default2; + v_default2 := v_default; + if (v_default == v_default2) { setverdict(pass) } + else { setverdict(fail) } + } + + control{ + execute(TC_Sem_060208_default_type_001()); + } +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NOTES b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..39ea0e68a7aaecce0b75db0748c5b21d96ff693f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NOTES @@ -0,0 +1,5 @@ +- NOTE: rules involving message based communications are tested as part of section 22.2 +- NOTE: rules involving procedure based communications are tested as part of section 22.3 +- NOTE: rules for using addresses are tested as a part of the section 6.2.12 +- NOTE: rules for using map parameters are tested as a part of the section 21.1.1 +- NOTE: rules for using unmap parameters are tested as a part of the section 21.1.1 \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2cc2a90d3db53464a2914fef693bdc3394727a2f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that restriction of port definitions are appropriately handles + ** @verdict pass reject + *****************************************************************/ + +module NegSem_060209_CommunicationPortTypes_001 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne message { + address MyType1; + address MyType2; //more than one address type + inout integer; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_001() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c6ccceec67a565dbcd03f4b6ab364676e80ccea --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_002.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that restriction of port definitions are appropriately handles + ** @verdict pass reject + *****************************************************************/ + +module NegSem_060209_CommunicationPortTypes_002 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne message { + address MyType1; + inout integer; + map param (in integer p1, inout MyType2 p2); + map param (in integer p1, out MyType2 p2); //more than one map parameter type + unmap param (in MyType3 p1, out integer p2); + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_002() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d75af872520ad0a7f27a73c69cae8c70278cd45 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_003.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that restriction of port definitions are appropriately handles + ** @verdict pass reject + *****************************************************************/ + +module NegSem_060209_CommunicationPortTypes_003 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne message { + address MyType1; + inout integer; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + unmap param (in MyType3 p1, inout integer p2); //more than one map parameter type + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_003() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..674c38dd279502c239bd0d71b89bdd7661a26aab --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_004.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that an error is generated when a message port type definition contains no message types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Each port type definition shall have one or more lists indicating the allowed collection of +// (message) types ... with the allowed communication direction. + +module NegSem_060209_CommunicationPortTypes_004 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne message { + address MyType1; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4eec50c56d03abeb9babab7ddddd6a54fd27e4fb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_005.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that an error is generated when a procedure port type definition contains no signatures + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Each port type definition shall have one or more lists indicating the allowed collection of +// ... procedure signatures with the allowed communication direction. + +module NegSem_060209_CommunicationPortTypes_005 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne procedure { + address MyType1; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60beca4b3c624cf01a997f7ea10753d72b68b89a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_006.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that an error is generated when a signature port definition contains multiple address clauses + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction a: +// At most one address type should be bound to a port type. + +module NegSem_060209_CommunicationPortTypes_006 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S() return integer; + + type port MyMessagePortTypeOne procedure { + address MyType1; + address MyType2; //more than one address type + in S; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_006() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_006()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..215b6ea7181095014b8e3fe4ed4b13e4836278e4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_007.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that an error is generated when a signature port definition contains multiple map clauses + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction b: +// At most one map parameter list should be defined for a port type. + +module NegSem_060209_CommunicationPortTypes_007 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S() return integer; + + type port MyMessagePortTypeOne procedure { + address MyType1; + in S; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + map param (in integer p1, inout MyType2 p2); // more than 1 map clause + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_007() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_007()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3907a1a118b4c324a16697569fa6413bbebfdef0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/NegSem_060209_CommunicationPortTypes_008.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that an error is generated when a signature port definition contains multiple unmap clauses + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// At most one unmap parameter list should be defined for a port type. + +module NegSem_060209_CommunicationPortTypes_008 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S() return integer; + + type port MyMessagePortTypeOne procedure { + unmap param (in MyType3 p1, out integer p2); + address MyType1; + in S; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); // more than 1 unmap clause + } + + type component GeneralComp { + port MyMessagePortTypeOne pt_myPort; + } + + testcase TC_NegSem_060209_CommunicationPortTypes_008() runs on GeneralComp system GeneralComp { + setverdict(fail); + } + + control{ + execute(TC_NegSem_060209_CommunicationPortTypes_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1030a17caabe897e781f86637bf5ca4b0b7efdf3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_004.ttcn @@ -0,0 +1,74 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map and unmap param and local port address are allowed in a testcase block + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_060209_CommunicationPortTypes_004 { + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType1 { + integer field1, + charstring field2, + boolean field3 + } + + type record MyMessageType2 { + integer g1, + charstring g2 + } + + type record MyMessageType3 { + boolean h1, + MyMessageType3 h2 optional + } + + type port MyMessagePortType message { + address MyMessageType1; + inout all; + map param (in integer p1, inout charstring p2); + unmap param (in MyMessageType3 p1, inout MyMessageType2 p2); + } + + const MyMessageType1 c_myTemplate1 := { + field1 := 2, + field2 := "foobar", + field3 := true + } + + const MyMessageType2 c_myTemplate2 := { + g1 := 2, + g2 := "foo" + } + + const MyMessageType3 c_myTemplate3 := { + h1 := false, + h2 := { + h1:= true, + h2 := omit + } + } + + testcase TC_Sem_060209_CommunicationPortTypes_004() runs on GeneralComp system GeneralComp { + var charstring v_varString := "foobar"; + var MyMessageType2 v_myTemplate2 := c_myTemplate2; + + map(mtc:pt_myPort, system:pt_myPort) param(5, v_varString); + + pt_myPort.send(13) to c_myTemplate1; + log("Map inout parameter", v_varString); + + unmap(mtc:pt_myPort, system:pt_myPort) param(c_myTemplate3, v_myTemplate2); + log("Unmap inout parameter", v_myTemplate2); + + setverdict(pass); + } + + control{ + execute(TC_Sem_060209_CommunicationPortTypes_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7caebac354e43a400be4b5ebddbfa5846a7ab3d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Sem_060209_CommunicationPortTypes_005.ttcn @@ -0,0 +1,241 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:6.2.9, Ensure that parameter MessageType of the port shall be data type + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirements are tested: + * 6.2.9 Communication port types - Restriction e. MessageType shall be a data type as defined in clause 3.1. + */ + +module Sem_060209_CommunicationPortTypes_005 { + + type component GeneralComp { + port loopbackPort pt_myPort; + } + + type record MyRec{float field1}; + type set MySet{}; + type record of integer MyRoI; + type set of integer MySoI; + type enumerated MyEnumType {a,b,c}; + type union MyUnionType + { + integer number, + charstring string + }; + + type port loopbackPort message { + //allowed MessageTypes given in clause 3.1: + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout octetstring; + inout hexstring; + inout charstring; + inout universal charstring; + inout anytype; + inout MyRec; + inout MyRoI; + inout MySet; + inout MySoI; + inout MyEnumType; + inout MyUnionType; + } + + + testcase TC_Sem_060209_CommunicationPortTypes_005() runs on GeneralComp { + + var anytype v_a; + var integer j := 100; + var boolean v_2 := true; + var verdicttype v_3 := pass; + var universal charstring v_4 := "\q{0,0,1,113}"; + var MyRec MyR :={field1 := 1.0}; + var MySet MyS :={}; + var MyRoI RoI := {1,2,3}; + var MySoI SoI := {1,2,3}; + var MyEnumType enu :=a; + var MyUnionType uni :={number:=1}; + v_a.integer :=1; + +//send integer via port + pt_myPort.send(j); + alt { + [] pt_myPort.receive(j) { + setverdict(pass,"Send success, received:", j); + } + [] pt_myPort.receive { + setverdict(fail,"integer sent failed",j); + } + } +//send float via port + pt_myPort.send(int2float(j)); + alt { + [] pt_myPort.receive(int2float(j)) { + setverdict(pass,"Send success,received:", int2float(j)); + } + [] pt_myPort.receive { + setverdict(fail,"float sent failed", int2float(j)); + } + } +//send character via port + pt_myPort.send(int2char(j)); + alt { + [] pt_myPort.receive(int2char(j)) { + setverdict(pass,"Send success,received:", int2char(j)); + } + [] pt_myPort.receive { + setverdict(fail,"character sent failed", int2char(j)); + } + } + //send bitstring via port + pt_myPort.send(int2bit(j,8)); + alt { + [] pt_myPort.receive(int2bit(j,8)) { + setverdict(pass,"Send success,received:", int2bit(j,8)); + } + [] pt_myPort.receive { + setverdict(fail,"bitstring sent failed", int2bit(j,8)); + } + } +//send octetstring via port + pt_myPort.send(int2oct(j,4)); + alt { + [] pt_myPort.receive(int2oct(j,4)) { + setverdict(pass,"Send success,received:", int2oct(j,4)); + } + [] pt_myPort.receive { + setverdict(fail,"octetstring sent failed", int2oct(j,4)); + } + } +//send hexstring via port + pt_myPort.send(int2hex(j,4)); + alt { + [] pt_myPort.receive(int2hex(j,4)) { + setverdict(pass,"Send success,received:",int2hex(j,4)); + } + [] pt_myPort.receive { + setverdict(fail,"octetstring sent failed",int2hex(j,4)); + } + } +//send charstring via port + pt_myPort.send(int2str(j)); + alt { + [] pt_myPort.receive(int2str(j)) { + setverdict(pass,"Send success,received:",int2str(j)); + } + [] pt_myPort.receive { + setverdict(fail,"charstring sent failed",int2str(j)); + } + } +//send boolean via port + pt_myPort.send(v_2); + alt { + [] pt_myPort.receive(v_2) { + setverdict(pass,"Send success,received:",v_2); + } + [] pt_myPort.receive { + setverdict(fail,"charstring sent failed", v_2); + } + } +//send verdicttype via port + pt_myPort.send(v_3); + alt { + [] pt_myPort.receive(v_3) { + setverdict(pass,"Send success,received:",v_3); + } + [] pt_myPort.receive { + setverdict(fail,"verdict type sent failed", v_3); + } + } +//send universal charstring via port + pt_myPort.send(v_4); + alt { + [] pt_myPort.receive(v_4) { + setverdict(pass,"Send success,received:",v_4); + } + [] pt_myPort.receive { + setverdict(fail,"universal charstring sent failed", v_4); + } + } +//send anytype via port + pt_myPort.send(v_a.integer); + alt { + [] pt_myPort.receive(v_a.integer) { + setverdict(pass,"Send success,received:",v_a.integer); + } + [] pt_myPort.receive { + setverdict(fail,"anytype sent failed", v_a.integer); + } + } +//send record via port + pt_myPort.send(MyR); + alt { + [] pt_myPort.receive(MyR) { + setverdict(pass,"Send success,received:",MyR); + } + [] pt_myPort.receive { + setverdict(fail,"Record sent failed", MyR); + } + } +//send set via port + pt_myPort.send(MyS); + alt { + [] pt_myPort.receive(MyS) { + setverdict(pass,"Send success,received:",MyS); + } + [] pt_myPort.receive { + setverdict(fail,"Set sent failed", MyS); + } + } +//send record of integers via port + pt_myPort.send(RoI); + alt { + [] pt_myPort.receive(RoI) { + setverdict(pass,"Send success,received:",RoI); + } + [] pt_myPort.receive { + setverdict(fail,"Record of integers sent failed", RoI); + } + } +//send set of integers via port + pt_myPort.send(SoI); + alt { + [] pt_myPort.receive(SoI) { + setverdict(pass,"Send success,received:",SoI); + } + [] pt_myPort.receive { + setverdict(fail,"Record of integers sent failed", SoI); + } + } +//send enum via port + pt_myPort.send(enu); + alt { + [] pt_myPort.receive(enu) { + setverdict(pass,"Send success,received:",enu); + } + [] pt_myPort.receive { + setverdict(fail,"Enum sent failed", enu); + } + } +//send union via port + pt_myPort.send(uni); + alt { + [] pt_myPort.receive(uni) { + setverdict(pass,"Send success,received:",uni); + } + [] pt_myPort.receive { + setverdict(fail,"Union sent failed", uni); + } + } + + } + + control{ + execute(TC_Sem_060209_CommunicationPortTypes_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee91bf75831ae94b225c1bfa2b1a028c4b6813f9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that message-based ports are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_001 { + + type record MsgType1 { + integer f1, + octetstring f2 + } + + type boolean MsgType2; + + type charstring MsgType3; + + // Message-based port which allows types MsgType1 and MsgType2 to be received at, MsgType3 to be + // sent via and any integer value to be send and received over the port + type port MyMessagePortTypeOne message { + in MsgType1, MsgType2; + out MsgType3; + inout integer + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3174efa4e671bf354f692b4aa2c8d4e64c766ef5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_002.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that message-based ports with address are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_002 { + + type port MyMessagePortTypeTwo message { + // if addressing is used on ports of type MyMessagePortTypeTwo + // the addresses have to be of type integer + address integer; + inout integer; + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..191ef58dae9819f67e7f7bf9da12d176b97f6c77 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_003.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Verify that it is possible to define procedute-based port types + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_003 { + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + signature S4(in integer p_par1) return bitstring; + signature S5(in charstring p_par1, out charstring p_par2) return boolean; + + // Procedure-based port which allows to accept calls to procedures S1, S2 and S4, call + // procedure S3. S5 calls can be both accepted or dispatched. + type port MyMessagePortTypeOne procedure { + in S1, S2; + out S3; + in S4; + inout S5; + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2831a10b1f19b74bd932850ea5ad25105b3afc9c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_004.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that procedure-based ports with address are accepted + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_004 { + + signature S1(); + + type port MyMessagePortType procedure { + inout S1; + // if addressing is used on ports of type MyMessagePortType + // the addresses have to be of type integer + address integer; + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3367c680e622cf983ab9810b866e324c18c69ec --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_005.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that map param is accepted by the port definition. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_005 { + + type record MyType { + integer f1 + } + + type port MyMessagePortTypeOne message { + inout integer; + map param (in MyType p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10c6a040e0a3c2d9b3f1a875889f89fd6c87902f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_006.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that unmap param is accepted by the port definition. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_006 { + + type record MyType { + integer f1 + } + + type port MyMessagePortTypeOne message { + inout integer; + unmap param (in MyType p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d39a49dc638a2e186b85a8515f5e7ffa8058981a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_007.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that complex port definition are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_007 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + type port MyMessagePortTypeOne message { + address MyType1; + inout integer, charstring; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac6e74ac3be3d72a21b9f8c3846f14a6254f9726 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_008.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that procedure-base port type definition can contain map parameter definition + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_008 { + + signature S1(); + + type record MyType { + integer f1 + } + + type port MyMessagePortTypeOne procedure { + inout S1; + map param (in MyType p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49073d7c2194d8a830dbe57839db83fef45c00b3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_009.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that procedure-base port type definition can contain unmap parameter definition + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_009 { + + signature S1(); + + type record MyType { + integer f1 + } + + type port MyMessagePortTypeOne procedure { + inout S1; + unmap param (in MyType p1, out integer p2); + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a576d84ac3ee7faf37de33381b42178aed4874c3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060209_comm_port_types/Syn_060209_CommunicationPortTypes_010.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2.9, Ensure that complex procedure-based port type definition are accepted + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_060209_CommunicationPortTypes_010 { + + type record MyType1 { + integer f1, + charstring f2 + } + + type record MyType2 { + integer g1, + charstring g2 + } + + type record MyType3 { + boolean h1, + MyType3 h2 optional + } + + signature S1(); + signature S2(in integer p_par1); + signature S3(in charstring p_par1); + + type port MyMessagePortTypeOne procedure { + inout S1, S2, S3; + map param (in integer p1, inout MyType2 p2); + unmap param (in MyType3 p1, out integer p2); + address MyType1; + } + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e25e56a22c2bfd14ad890031365c07ddf729bf64 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_001.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.10, Ensure that cyclic extension is not allowed + ** @verdict pass reject, noexecution + *****************************************************************/ + +/* The following requirements are tested: + * Restriction c.: It is allowed to extend component types that are defined by means of extension, + * as long as no cyclic chain of definition is created. + */ + +module NegSyn_060210_ReuseofComponentTypes_001 { + + type port loopbackPort message { + inout integer; + inout float; + } + + type component MyCompA extends GeneralComp { + port loopbackPort pt_myPortA; + } + + + type component MyCompB extends MyCompA { + var integer MyInt; + } + + + type component GeneralComp extends MyCompB { //error: cyclic extension + port loopbackPort pt_myPortB; + } + + testcase TC_NegSyn_060210_ReuseofComponentTypes_001() runs on GeneralComp { + + pt_myPortB.send(2); + } + + control{ + execute(TC_NegSyn_060210_ReuseofComponentTypes_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69f6e45fe75ccf5d5ca446330647ff8ee2d92508 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_002.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.10, Ensure that extending a component that occurs name clash is not allowed + ** @verdict pass reject, noexecution + *****************************************************************/ + +/* The following requirements are tested: + * Restriction b.: When defining component types by extending more than one parent type, + * there shall be no name clash between the definitions of the different parent types + */ + +module NegSyn_060210_ReuseofComponentTypes_002 { + + type port loopbackPort message { + inout integer; + inout float; + } + + type component MyCompA { + port loopbackPort pt_myPortA; + } + + + type component MyCompB { + var integer MyInt; + } + + + type component GeneralComp extends MyCompA, MyCompB { + port loopbackPort pt_myPortB; + var integer MyInt; //error: name clash + } + + testcase TC_NegSyn_060210_ReuseofComponentTypes_002() runs on GeneralComp { + + pt_myPortA.send(2); + pt_myPortB.send(2.0); + } + + control{ + execute(TC_NegSyn_060210_ReuseofComponentTypes_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b77a8b4edfdda440564972c8264618bdf7518f5e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/NegSyn_060210_ReuseofComponentTypes_003.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.10, Ensure that extending a component that occurs name clash is not allowed + ** @verdict pass reject, noexecution + *****************************************************************/ + +/* The following requirements are tested: + * When defining component types by extension, there shall be + * no name clash between the definitions being taken from the parent type + * and the definitions being added in the extended type + */ + +module NegSyn_060210_ReuseofComponentTypes_003 { + + type port loopbackPort message { + inout integer; + inout float; + } + + type component MyCompA { + port loopbackPort pt_myPortA; + var integer MyInt; + } + + + type component GeneralComp extends MyCompA { + port loopbackPort pt_myPortB; + var integer MyInt; //error: name clash from parent type + } + + testcase TC_NegSyn_060210_ReuseofComponentTypes_003() runs on GeneralComp { + + pt_myPortA.send(2); + pt_myPortB.send(2.0); + } + + control{ + execute(TC_NegSyn_060210_ReuseofComponentTypes_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..516fcb96047bf4943b7b31655cf1de2d35a9862a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_001.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.10, Ensure that extending a component with another component works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirements are tested: + * It is allowed to have one component type extending several parent types in one definition, + * which have to be specified as a comma-separated list of types in the definition. + * Any of the parent types may also be defined by means of extension. + */ + +module Sem_060210_ReuseofComponentTypes_001 { + + //MyComp has a port + type component MyComp { + port loopbackPort pt_myPort; + } + +//Component GeneralComp has a timer and a port extended from MyComp + type component GeneralComp extends MyComp { + timer t; + } + + type port loopbackPort message { + inout integer; + } + + + testcase TC_Sem_060210_ReuseofComponentTypes_001() runs on GeneralComp { + + //Send an integer: + pt_myPort.send(2); + + alt { + [] pt_myPort.receive(2) { + setverdict(pass, "Receive successful"); + } + [] pt_myPort.receive { + setverdict(fail, "Unexpected result"); + } + } + + } + + control{ + execute(TC_Sem_060210_ReuseofComponentTypes_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3d29bf5f7ec6ea7710a6a9b7b983cfc60f2ede7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_002.ttcn @@ -0,0 +1,86 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:6.2.10, Ensure that extending a component with several other component works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirements are tested: + * When defining component types by extending more than one parent type, + * there shall be no name clash between the definitions of the different parent types, + * i.e. there shall not be a port, variable, constant or timer identifier that is declared + * in any two of the parent types (directly or by means of extension). + */ + +module Sem_060210_ReuseofComponentTypes_002 { + + //MyCompA has a port pt_myPortA + type component MyCompA { + port loopbackPort pt_myPortA; + } + + //MyComp has a port pt_myPortB + type component MyCompB { + port loopbackPort pt_myPortB; + } + +//Component GeneralComp has a timer and inherit two ports from MyCompA and MyCompB + type component GeneralComp extends MyCompA, MyCompB { + timer t; + } + + type port loopbackPort message { + inout integer; + inout float; + } + + function loopback() runs on GeneralComp system GeneralComp { + var integer v_i; + var float v_f; + while (true) { + alt { + [] pt_myPortA.receive(integer:?) -> value v_i { pt_myPortA.send(v_i); } + [] pt_myPortA.receive(float:?) -> value v_f { pt_myPortA.send(v_f); } + [] pt_myPortB.receive(integer:?) -> value v_i { pt_myPortB.send(v_i); } + [] pt_myPortB.receive(float:?) -> value v_f { pt_myPortB.send(v_f); } + } + } + } + + testcase TC_Sem_060210_ReuseofComponentTypes_002() runs on GeneralComp system GeneralComp { + + var GeneralComp v_server := GeneralComp.create; + + connect(mtc:pt_myPortA, v_server:pt_myPortA); + connect(mtc:pt_myPortB, v_server:pt_myPortB); + + v_server.start(loopback()); + + //Send an integer from pt_myPortA: + pt_myPortA.send(2); + alt { + [] pt_myPortA.receive(2) { + setverdict(pass,"Receive successful"); + } + [] pt_myPortA.receive { + setverdict(fail,"Unexpected result"); + } + } + + //Send an integer from pt_myPortB: + pt_myPortB.send(1.0); + alt { + [] pt_myPortB.receive(1.0) { + setverdict(pass,"Receive successful"); + } + [] pt_myPortB.receive { + setverdict(fail,"Unexpected result"); + } + } + + } + + control{ + execute(TC_Sem_060210_ReuseofComponentTypes_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4530a35ea0085acef1fa92e6c9e5bcda24af6c38 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060210_component_types/06021002_reuse_component_type/Sem_060210_ReuseofComponentTypes_003.ttcn @@ -0,0 +1,90 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.10, Ensure that extending a component with and extended component works properly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* The following requirements are tested: + * It is allowed to have one component type extending several parent types in one definition, + * which have to be specified as a comma-separated list of types in the definition. + * Any of the parent types may also be defined by means of extension. + */ + +module Sem_060210_ReuseofComponentTypes_003 { + + //MyCompA has a port pt_myPortA + type component MyCompA { + port loopbackPort pt_myPortA; + var integer MyInt; + } + + //MyComp has a port pt_myPortB and inherit a port (pt_myPortA) form MyCompA + type component MyCompB extends MyCompA { + port loopbackPort pt_myPortB; + } + +//Component GeneralComp has a timer and inherit two ports from MyCompB (pt_myPortA and pt_myPortB) + type component GeneralComp extends MyCompB { + timer t; + } + + type port loopbackPort message { + inout integer; + inout float; + } + + + function loopback() runs on GeneralComp { + var integer v_i; + var float v_f; + while (true) { + alt { + [] pt_myPortA.receive(integer:?) -> value v_i { pt_myPortA.send(v_i); } + [] pt_myPortA.receive(float:?) -> value v_f { pt_myPortA.send(v_f); } + [] pt_myPortB.receive(integer:?) -> value v_i { pt_myPortB.send(v_i); } + [] pt_myPortB.receive(float:?) -> value v_f { pt_myPortB.send(v_f); } + } + } + } + + testcase TC_Sem_060210_ReuseofComponentTypes_003() runs on GeneralComp system GeneralComp { + + var GeneralComp v_server := GeneralComp.create; + + connect(mtc:pt_myPortA, v_server:pt_myPortA); + connect(mtc:pt_myPortB, v_server:pt_myPortB); + + v_server.start(loopback()); + + //Set a value to MyInt: + MyInt := 10; + + //Send an integer from pt_myPortA: + pt_myPortA.send(2); + alt { + [] pt_myPortA.receive(2) { + setverdict(pass,"Receive successful"); + } + [] pt_myPortA.receive { + setverdict(fail,"Unexpected result"); + } + } + + //Send an integer from pt_myPortB: + pt_myPortB.send(1.0); + alt { + [] pt_myPortB.receive(1.0) { + setverdict(pass,"Receive successful"); + } + [] pt_myPortB.receive { + setverdict(fail,"Unexpected result"); + } + } + + } + + control{ + execute(TC_Sem_060210_ReuseofComponentTypes_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9167b1096d67061245784f8aa1cb93033c742745 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure right type checking for address types in ports + ** @verdict pass reject + ***************************************************/ +module NegSem_060212_AddressingEntitiesInsideSut_001 { + type integer address; + + type port PortType1 message { + address charstring; + inout all; + } + + type port PortType2 message { + inout all; + } + + type component TestCaseComp { + port PortType1 p1; + } + + testcase TC_NegSem_060212_AddressingEntitiesInsideSut_001() runs on TestCaseComp system TestCaseComp { + + var address v_int := 1; + var PortType1.address v_char := "test"; + + // port 1 has charstring address, should not be accepted + p1.send(5) to v_int; + + setverdict(fail); + } + + control { + execute(TC_NegSem_060212_AddressingEntitiesInsideSut_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..afdf27451a3daea079fe8132c9a66afc27bd8570 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_002.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure that address type cannot be used in a from part of receive operation with connected ports + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + * Restrictions c) The address data type shall not be used in the to, + * from and sender parts of receive and send operations of connected ports, + * i.e, ports used for the communication among test components.*/ + + +module NegSem_060212_AddressingEntitiesInsideSut_002 { + + type integer MyAddress; + type integer MyMessType; + + type port PortType message { + address MyAddress; + inout MyMessType; + } + + type component TestCaseComp { + port PortType p; + } + + function Sendmessage() runs on TestCaseComp + { + if(p.checkstate("Connected")) { + p.send(MyMessType: 1) to mtc; + } else { + setverdict(fail); + } + } + + + + testcase TC_NegSem_060212_AddressingEntitiesInsideSut_002() runs on TestCaseComp system TestCaseComp { + + var TestCaseComp v_ptcA := TestCaseComp.create alive; + + connect(mtc:p, v_ptcA:p); + + v_ptcA.start(Sendmessage()); + + + p.receive(MyMessType:1) from PortType.address:?; //error: address type is allowed in from part receive operation + + setverdict(pass); + } + + control { + execute(TC_NegSem_060212_AddressingEntitiesInsideSut_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85bfaa04a59ba2b7ab4b75d594e6383f01ec4bc5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_003.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure that address type cannot be used in a sender part of receive operation with connected ports + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + * Restrictions c) The address data type shall not be used in the to, + * from and sender parts of receive and send operations of connected ports, + * i.e, ports used for the communication among test components.*/ + + +module NegSem_060212_AddressingEntitiesInsideSut_003 { + + type integer MyAddress; + type integer MyMessType; + type integer address; + + + type port PortType message { + address MyAddress; + inout MyMessType; + } + + type component TestCaseComp { + port PortType p; + } + + function Sendmessage() runs on TestCaseComp + { + if(p.checkstate("Connected")) { + p.send(MyMessType: 1) to mtc; + } else { + setverdict(fail,"Not connected"); + } + } + + + + testcase TC_NegSem_060212_AddressingEntitiesInsideSut_003() runs on TestCaseComp system TestCaseComp { + + var TestCaseComp v_ptcA := TestCaseComp.create alive; + + var address MyAddr := 1; + + connect(mtc:p, v_ptcA:p); + + v_ptcA.start(Sendmessage()); + + + p.receive(MyMessType:1) -> sender MyAddr; //error: address type is allowed in sender part receive operation + + setverdict(pass); + } + + control { + execute(TC_NegSem_060212_AddressingEntitiesInsideSut_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46a7cefdab50f3b4e07480bfbbb8bfc758dcd741 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/NegSem_060212_AddressingEntitiesInsideSut_004.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure that address type cannot be used in a to part of sender operation with connected ports + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + * Restrictions c) The address data type shall not be used in the to, + * from and sender parts of receive and send operations of connected ports, + * i.e, ports used for the communication among test components.*/ + + +module NegSem_060212_AddressingEntitiesInsideSut_004 { + + type integer MyAddress; + type integer MyMessType; + type integer address; + + + type port PortType message { + address MyAddress; + inout MyMessType; + } + + type component TestCaseComp { + port PortType p1; + port PortType p2; + } + + function CheckConnected() runs on TestCaseComp + { + if(p1.checkstate("Connected")) { + setverdict(pass,"Connected"); + } else { + setverdict(fail,"Not connected"); + } + } + + testcase TC_NegSem_060212_AddressingEntitiesInsideSut_004() runs on TestCaseComp system TestCaseComp { + + var PortType.address MySUTentity := 1; + + + connect(mtc:p1, mtc:p2); + + p1.send(MyMessType: 1) to MySUTentity; //error: address type is allowed in to part send operation + + setverdict(pass); + } + + control { + execute(TC_NegSem_060212_AddressingEntitiesInsideSut_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e855cc6f5a91c985c15bbfbddaf16e43bae9e868 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure null assignment is accepted for addresses + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060212_AddressingEntitiesInsideSut_001 { + type integer address; + + type component TestCaseComp { + } + + testcase TC_Sem_060212_AddressingEntitiesInsideSut_001() runs on TestCaseComp system TestCaseComp { + + var address v_int := null; // valid value for an address + + setverdict(pass); + } + + control { + execute(TC_Sem_060212_AddressingEntitiesInsideSut_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92e2b7e85c1aefbda8ab493b15f8a23d9d60f8f1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060212_addressing_entities_inside_sut/Sem_060212_AddressingEntitiesInsideSut_002.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.12, Ensure that the right port address is used + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_060212_AddressingEntitiesInsideSut_002 { + type integer address; + + type port PortType1 message { + address charstring; + inout all; + } + + type port PortType2 message { + inout all; + } + + type component TestCaseComp { + port PortType1 p1; + port PortType2 p2; + } + + testcase TC_Sem_060212_AddressingEntitiesInsideSut_002() runs on TestCaseComp system TestCaseComp { + + var address v_int := 1; + var PortType1.address v_char := "test"; + + map(mtc:p1, system:p1); + map(mtc:p2, system:p2); + + // port 1 has charstring address + p1.send(5) to v_char; + + // port 2 has integer address + p2.send(5) to v_int; + p2.send(5) to 5; + + setverdict(pass); + } + + control { + execute(TC_Sem_060212_AddressingEntitiesInsideSut_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0c4be323d6af50ffc8270492d9c2ee63fbce7fe --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_001.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ +module NegSem_06021301_LengthSubtyping_001 { + type record length(0..10) of integer RecordOfLengthLessThan10; + + type RecordOfLengthLessThan10 RecordOfLength4To5 length(4..5); + type RecordOfLength4To5 RecordOfLength6 length(6); //length out of parent type range + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67795c5ba9a0ea18c1f333bbd6a762de250d8089 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_002.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ +module NegSem_06021301_LengthSubtyping_002 { + type set length(0..10) of integer SetOfLengthLessThan10; + + type SetOfLengthLessThan10 SetOfLength4To5 length(4..5); + type SetOfLength4To5 SetOfLength6 length(6); //length out of parent type range + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d9a90ce0231d3f691b6f67227ff5792bd3946d8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_003.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ +module NegSem_06021301_LengthSubtyping_003 { + type record length(0..!10) of integer RecordOfLengthLessThan10; //only inclusive boundary is allowed + + type RecordOfLengthLessThan10 RecordOfLength4To5 length(4..5); + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc383e77c67d0fa8b4a280847d1a6d1dec31e491 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_004.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ +module NegSem_06021301_LengthSubtyping_004 { + type set length(0..10) of integer SetOfLengthLessThan10; + + type SetOfLengthLessThan10 SetOfLength5 length(!4..5); //only inclusive boundary is allowed + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8800b23c21826dc45f019564ee50a5e2c84fd6dc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_005.ttcn @@ -0,0 +1,15 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ +/*The following requirement is tested: + * In case of the range syntax the upper bound shall not be lesser than the lower bound value. + */ +module NegSem_06021301_LengthSubtyping_005 { + type set length(0..10) of integer SetOfLengthLessThan10; + + type SetOfLengthLessThan10 SetOfLength5 length(5..2); //Error: In case of the range syntax the upper bound shall not be lesser than the lower bound value. + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72743574bdab012f8c678a598a6e5b2cc360880e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/NegSem_06021301_LengthSubtyping_006.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass reject + ***************************************************/ + +/*The following requirement is tested: + * In case of the range syntax the upper bound shall not be lesser than the lower bound value. +*/ + +module NegSem_06021301_LengthSubtyping_006 { + type record length(0..10) of integer RecordOfLengthLessThan10; + + type RecordOfLengthLessThan10 RecordOfLengthLessThan5 length(5..2); //Error: In case of the range syntax the upper bound shall not be lesser than the lower bound value. + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..605dda683aed3eb570879aabe1594b6373e513e5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_001.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_06021301_LengthSubtyping_001 { + type record length(10) of integer RecordOfLength10; //direct subtyping + type record length(0..10) of integer RecordOfLengthLessThan10; //direct subtyping + + type RecordOfLengthLessThan10 RecordOfLength6 length(6); //referenced subtyping + type RecordOfLengthLessThan10 RecordOfLength4To5 length(4..5); //referenced subtyping + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67271c1875fdd03e7bd4e0f18c1685582c245381 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021301_length_subtyping/Syn_06021301_LengthSubtyping_002.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:6.2.13.1, The length subtyping check for 'record of' or 'set of' types + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_06021301_LengthSubtyping_002 { + type set length(10) of integer SetOfLength10; //direct subtyping + type set length(0..10) of integer SetOfLengthLessThan10; //direct subtyping + + type SetOfLengthLessThan10 SetOfLength6 length(6); //referenced subtyping + type SetOfLengthLessThan10 SetOfLength4To5 length(4..5); //referenced subtyping + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f01bd4dd9437fb5a1296d3322cb6e17f118397d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for record types is properly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_06021302_ListSubtyping_001 { + type record MyRecord { + integer f1 optional, + charstring f2, + charstring f3 + } + + type MyRecord MyRecordSub1 ( + { f1 := omit, f2 := "user", f3 := "password" }, + { f1 := 1, f2 := "User", f3 := "Password" } + ); // a valid subtype of MyRecord containing 2 values + + type MyRecordSub1 MyRecordSub2 ( + { f1 := 1, f2 := "user", f3 := "password" }, + { f1 := 1, f2 := "User", f3 := "Password" } + ); //invalid subtype, the omitted element cannot be overwritten + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b157f7510f1418adfd55df29823408292c4f4824 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/NegSem_06021302_ListSubtyping_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for record types is properly handled + ** @verdict pass reject + ***************************************************/ +module NegSem_06021302_ListSubtyping_002 { + type record MyRecord { + integer f1 optional, + charstring f2, + charstring f3 + } + + type MyRecord MyRecordSub1 ( + { f2 := "user", f3 := "password" }, + { f2 := "User", f3 := "Password" } + ); // a valid subtype of MyRecord containing 2 values + + type MyRecordSub1 MyRecordSub2 ( + { f1 := 1, f2 := "user", f3 := "password" }, + { f1 := 2, f2 := "user", f3 := "Password" } + ); //invalid subtype, contains wrong combination of f2 and f3 + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ec7567c1c1d420c8ac138b0bd669c9608ded7d8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_001.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for record types is properly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06021302_ListSubtyping_001 { + + type component GeneralComp { + } + + type record MyRecord { + integer f1 optional, + charstring f2, + charstring f3 + } + + type MyRecord MyRecordSub1 ( + { f1 := omit, f2 := "user", f3 := "password" }, + { f1 := 1, f2 := "User", f3 := "Password" } + ); // a valid subtype of MyRecord containing 2 values + + +testcase TC_Sem_06021302_ListSubtyping_001() runs on GeneralComp { + var MyRecordSub1 v_record := { f1 := 1, f2 := "User", f3 := "Password" }; + + if ( match(v_record,{ 1, "User", "Password" }) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06021302_ListSubtyping_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b735263bb58a78f8db48a88c4bcb86956d8c4db --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for record types is properly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06021302_ListSubtyping_002 { + + type component GeneralComp { + } + + type record MyRecord { + integer f1 optional, + charstring f2, + charstring f3 + } + + type MyRecord MyRecordSub1 ( + { f1 := *, f2 := "user", f3 := "password" }, + { f1 := *, f2 := "User", f3 := "Password" } + ); // a valid subtype, f1 may contain any values + + +testcase TC_Sem_06021302_ListSubtyping_002() runs on GeneralComp { + var MyRecordSub1 v_record := { f1 := 8, f2 := "User", f3 := "Password" }; + + if ( match(v_record,{ 8, "User", "Password" }) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06021302_ListSubtyping_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d89956fd85e73781adfc95536baebe9a1b7c4ec --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060213_subtyping_of_structured_types/06021302_list_subtyping/Sem_06021302_ListSubtyping_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.2.13.2, ensure that list subtyping check for record types is properly handled + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_06021302_ListSubtyping_003 { + + type component GeneralComp { + } + + type record MyRecord { + integer f1 optional, + charstring f2, + charstring f3 + } + + type MyRecord MyRecordSub1 ( + { f1 := *, f2 := "user", f3 := pattern "password|Password" }, + { f1 := (1 .. 10), f2 := "User", f3 := ? } + ); // a valid subtype + + +testcase TC_Sem_06021302_ListSubtyping_003() runs on GeneralComp { + var MyRecordSub1 v_record := { f1 := omit, f2 := "user", f3 := "Password" }; + var template MyRecordSub1 m_match := { *, "user", "Password" }; + + if ( match(v_record,m_match) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + +control { + execute(TC_Sem_06021302_ListSubtyping_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c9f937109c542e469b65b65ea68d72793a7842a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_001.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can not be used for a union type. + ** @verdict pass reject + ***************************************************/ +module NegSem_0602_TopLevel_001 { + + type component GeneralComp { + } + + type union MyUnion { + integer field1, + charstring field2, + float field3 + } + + testcase TC_NegSem_0602_TopLevel_001() runs on GeneralComp { + + var MyUnion v_myUnion := {5}; //value list notation can not be used for a union type + + } + + control { + execute(TC_NegSem_0602_TopLevel_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e083f216de017da6ae7e833ce6b755ca6c5b0875 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_002.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can not be used for a record type. + ** @verdict pass reject + ***************************************************/ +module NegSem_0602_TopLevel_002 { + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2, + float field3 + } + + testcase TC_NegSem_0602_TopLevel_002() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + var integer Integer1 :=3; + v_myRecord[0] := Integer1;//not possible to use index notation on a record type + + } + + control { + execute(TC_NegSem_0602_TopLevel_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..efccf8878302542e95b63b7f75507c8b2d07006d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_003.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can not be used for a set type. + ** @verdict pass reject + ***************************************************/ +module NegSem_0602_TopLevel_003 { + + type component GeneralComp { + } + + type set MySet { + integer field1, + charstring field2, + float field3 + } + + testcase TC_NegSem_0602_TopLevel_003() runs on GeneralComp { + + var MySet v_mySet := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + var integer Integer1 :=3; + v_mySet[0] := Integer1;//not possible to use index notation on a set type + + } + + control { + execute(TC_NegSem_0602_TopLevel_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9efddf59b07a52e340b412d859834995198f951f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSem_0602_TopLevel_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can not be used for a union type. + ** @verdict pass reject + ***************************************************/ +module NegSem_0602_TopLevel_004 { + + type component GeneralComp { + } + + type union MyUnion { + integer field1, + charstring field2, + float field3 + } + + testcase TC_NegSem_0602_TopLevel_004() runs on GeneralComp { + + var MyUnion v_myUnion := { + field1 := 5 + }; + + var integer Integer1 :=3; + v_myUnion[0] := Integer1;//not possible to use index notation on a union type + + } + + control { + execute(TC_NegSem_0602_TopLevel_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4eafc585a6f7dccbb03bfc987a3609a9153ca221 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_001.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Invalid recursive union type definition causing an error + ** @verdict pass reject + ***************************************************/ +module NegSyn_0602_TopLevel_001 { + // In case of union types, to avoid infinite recursion, at least one of the alternatives shall not reference its own type. + type union MyUnion { + MyUnion choice1, + MyUnion choice2 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b6d867dc4bdd7327fb88648369b3ceb126a82ad --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_002.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Invalid recursive record type definition causing an error + ** @verdict pass reject + ***************************************************/ +module NegSyn_0602_TopLevel_002 { + // In case of record and set types, to avoid infinite recursion, fields referencing to its own type, shall be optional. + type record MyRecord { + integer field1, + MyRecord field2, + integer field3 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14bbeafe349c812b24111372e06118521f8e6ba7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_003.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Combined value list and assignment notation not allowed in the same (immediate) context. + ** @verdict pass reject + ***************************************************/ +module NegSyn_0602_TopLevel_003 { + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + const MyRecord c_rec := { + field1 := 5, + "hi", // combined value list and assignment notation not allowed in the same (immediate) context. + field3 := 3.14 + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3eab198d702a5723d0ba6247881f1b46a09e5f10 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_004.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2, Combined value list and assignment notation not allowed in the same (immediate) context. + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + *The assignment notation can be used for record, record of, set, setof and union value + * notations and for arrays. In this notation each field shall not appear more than once. +*/ + +module NegSyn_0602_TopLevel_004 { + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + const MyRecord c_rec := { + field1 := 5, + field1 := 6, // error: already appeared field + field3 := 3.14 + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..234278aa37522db5916ee7deadf1b62b4f639521 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2, Combined value list and assignment notation not allowed in the same (immediate) context. + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * The index notation can be used for record of and setof value notations and for arrays. + * In this notation each index shall not appear more than once and shall conform to the range of indices allowed by the type definition. +*/ + +module NegSyn_0602_TopLevel_005 { + + type set of integer MySetOfType; + type component GeneralComp { + } + +testcase TC_NegSyn_0602_TopLevel_005() runs on GeneralComp { + + var MySetOfType v_set := { + [0] := 1, + [1] := 2, + [1] := 3 // error already indexed + }; + + if ( match(v_set, {1,3})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_NegSyn_0602_TopLevel_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2695fc588457712a2655b285f8dc40918f7fd0c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_006.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2, Combined value list and assignment notation not allowed in the same (immediate) context. + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * The assignment notation can be used for record, record of, set, setof and union value + * notations and for arrays. In this notation each field shall not appear more than once. +*/ + +module NegSyn_0602_TopLevel_006 { + + type set MySetType{ + integer field1, + charstring field2 + } + + type component GeneralComp { + } + +testcase TC_NegSyn_0602_TopLevel_006() runs on GeneralComp { + + var MySetType v_set := { + field1 := 5, + field1 := 6, // error: already appeared field + field2 := "abc" + }; + + if ( match(v_set, {5,"abc"})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_NegSyn_0602_TopLevel_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6e0fc0c4ea99e0f47aa87b440a30fa8dfaafa01 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/NegSyn_0602_TopLevel_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:6.2, Combined value list and assignment notation not allowed in the same (immediate) context. + ** @verdict pass reject + ***************************************************/ +/* The following requirements are tested: + * The assignment notation can be used for record, record of, set, setof and union value + * notations and for arrays. In this notation each field shall not appear more than once. +*/ + +module NegSyn_0602_TopLevel_007 { + + type record of integer MyRecordOfType; + type component GeneralComp { + } + +testcase TC_NegSyn_0602_TopLevel_007() runs on GeneralComp { + + var MyRecordOfType v_RoI := { + [0] := 1, + [1] := 2, + [1] := 3 // error already indexed + }; + + if ( match(v_RoI, {1,3})) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_NegSyn_0602_TopLevel_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b21892f8ef9027d5f5539efe8b616f6c2d1d7a6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_001 { + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_001() runs on GeneralComp { + + var MyRecord v_myRecord := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + if (v_myRecord=={5,"hi",3.14}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..702ad622fe9dfb544e12152353ff4e211e3af305 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a record of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_002 { + + type component GeneralComp { + } + + type record of integer MyRecordOf; + + testcase TC_Sem_0602_TopLevel_002() runs on GeneralComp { + + var MyRecordOf v_allRecords := { + [0] := 1, + [1] := 2, + [2] := 3 + }; + + if (v_allRecords=={1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..195e4948f8e99e5f31faa3699919590d4b897ff4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a set type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_003 { + + type component GeneralComp { + } + + type set MySet { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_003() runs on GeneralComp { + + var MySet v_mySet := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; + + if (v_mySet=={field1 := 5, + field2 := "hi", + field3 := 3.14}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee4f6e6b1658b26781796d7f6def5e513d34a680 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a set of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_004 { + + type component GeneralComp { + } + + type set of integer MySetOf; + + testcase TC_Sem_0602_TopLevel_004() runs on GeneralComp { + + var MySetOf v_allSets := { + [0] := 1, + [1] := 2, + [2] := 3 + }; + + if (v_allSets=={1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a88a393f08213daea117d2615739d9c73b462e42 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_005.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for a union type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_005 { + + type component GeneralComp { + } + + type union MyUnion { + integer field1, + charstring field2, + float field3 + } + + testcase TC_Sem_0602_TopLevel_005() runs on GeneralComp { + + var MyUnion v_myUnion := { + field1 := 5 + }; + + if (v_myUnion.field1 == 5) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_006.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c04ca645b80712428d3099bcbc47781b74f06fc6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_006.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that assignment notation can be used for an array. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_006 { + + type component GeneralComp { + } + + type integer MyArray [3]; + + testcase TC_Sem_0602_TopLevel_006() runs on GeneralComp { + + var MyArray v_myArray; + v_myArray[0] := 1; + v_myArray[1] := 2; + v_myArray[2] := 3; + + if (v_myArray == {1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_007.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f56ada62980dfc0f6e1894cf2e99d52004efd76c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can be used for a record type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_007 { + + type component GeneralComp { + } + + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_007() runs on GeneralComp { + + var MyRecord v_myRecord := {5,"hi", 3.14}; + + if (v_myRecord=={5,"hi",3.14}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_008.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48aad93f085f64352ea8925be98bb740bbd49e94 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_008.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can be used for a record of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_008 { + + type component GeneralComp { + } + + type record of integer MyRecordOf; + + testcase TC_Sem_0602_TopLevel_008() runs on GeneralComp { + + var MyRecordOf v_allRecords := {1,2,3}; + + if (v_allRecords=={1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_009.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46abd816a85345ae84d07ad11ed77c4bb616000f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_009.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can be used for an arrays. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_009 { + + type component GeneralComp { + } + + type integer MyArray [3]; + + testcase TC_Sem_0602_TopLevel_009() runs on GeneralComp { + + var MyArray v_myArray := {1,2,3}; + var integer Integer1 :=3; + v_myArray[0] := Integer1; + Integer1 := v_myArray[1]; + + if ( match(v_myArray, {3,2,3}) and match(Integer1, 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_010.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..779ee3fb5742d998f8e668516128d1b0b4a08b69 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can be used for a set of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_010 { + + type component GeneralComp { + } + + type set of integer MySetOf; + + testcase TC_Sem_0602_TopLevel_010() runs on GeneralComp { + + var MySetOf v_allSets := {1,2,3}; + + if (v_allSets=={1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_011.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ec2b6b9cf66c6492afbd74c637f1f40577b0f27 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_011.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can be used for an array. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_011 { + + type component GeneralComp { + } + + type integer MyArray [3]; + + testcase TC_Sem_0602_TopLevel_011() runs on GeneralComp { + + var MyArray v_myArray := {1,2,3}; + + if (v_myArray == {1,2,3}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_012.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5908e3db9e931abb4a39d82ea54c8a684bf57731 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_012.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can be used for a record of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_012 { + + type component GeneralComp { + } + + type record of integer MyRecordOf; + + testcase TC_Sem_0602_TopLevel_012() runs on GeneralComp { + + var MyRecordOf v_allRecords := {1,2,3}; + var integer Integer1 :=3; + v_allRecords[0] := Integer1; + Integer1 := v_allRecords[1]; + + if ( match(v_allRecords, {3,2,3}) and match(Integer1, 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_013.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..853db1dad6a478908a4ac6fa52f3599be7f827d8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_013.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that indexed notation can be used for a set of type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_013 { + + type component GeneralComp { + } + + type set of integer MySetOf; + + testcase TC_Sem_0602_TopLevel_013() runs on GeneralComp { + + var MySetOf v_allSets := {1,2,3}; + var integer Integer1 :=3; + v_allSets[0] := Integer1; + Integer1 := v_allSets[1]; + + if ( match(v_allSets, {3,2,3}) and match(Integer1, 2)) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_014.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c426beb06796e2d069f4bd16603cfd08c0b7932c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Sem_0602_TopLevel_014.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:6.2, Ensure that value list notation can be used for a set type and the values + ** are assigned to the fields in the sequential order of the fields in the type definition. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_0602_TopLevel_014 { + + type component GeneralComp { + } + + type set MySet { + integer field1, + charstring field2 optional, + float field3 + } + + testcase TC_Sem_0602_TopLevel_014() runs on GeneralComp { + + var MySet v_mySet := {5,"hi",3.14};// SEE NOTE under 6.2.2 + + if (v_mySet=={5,"hi",3.14}) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_0602_TopLevel_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..302b3f5c2aa6874d6249a48860f91dcf674d69e5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_001.ttcn @@ -0,0 +1,13 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Valid recursive union type definition + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_0602_TopLevel_001 { + // In case of union types, to avoid infinite recursion, at least one of the alternatives shall not reference its own type. + type union MyUnion { + MyUnion choice1, + charstring choice2 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..031fb6f2c9755a469a4ad6b0c2d740847cf00cf0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_002.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Valid recursive record type definition + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_0602_TopLevel_002 { + // In case of record and set types, to avoid infinite recursion, fields referencing to its own type, shall be optional. + type record MyRecord { + integer field1, + MyRecord field2 optional, + float field3 + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e0e0e1585f97e6287efc844fa8767c109df971c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_003.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Valid recursive record type definition + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_0602_TopLevel_003 { + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + const MyRecord c_rec := { + field1 := 5, + field2 := "hi", + field3 := 3.14 + }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..668801ca4096ebf07ae196bfc7d52708f2e9513b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_004.ttcn @@ -0,0 +1,14 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, constant definition of a record type. + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_0602_TopLevel_004 { + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + const MyRecord c_rec := { 5, "foo", 3.14 }; +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_005.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c0fae31f519df3c87f2330aeaf70c5cb19a3bb5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/0602_toplevel/Syn_0602_TopLevel_005.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.2, Fields not mentioned are implicitly left unspecified. + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_0602_TopLevel_005 { + type record MyRecord { + integer field1, + charstring field2 optional, + float field3 + } + const MyRecord c_rec := { + field1 := 5, + // field2 implicitly unspecified + field3 := 3.14 + } with { + optional "implicit omit" + } +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..034d1e734b869080621c54d945bbd80c01f73932 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_001 { + type integer ConstrainedInt(1..10); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_001() runs on GeneralComp { + + var integer v_int:=15; + var ConstrainedInt v_constrainedInt; + + + v_constrainedInt:=v_int; // 15 not in range 1..10 + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4a39237ffbfa0d2c6fd630aedd96d8c8ce5d0cb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_002 { + type float ConstrainedFloat(1.0 .. 1E1); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_002() runs on GeneralComp { + + var integer v_float:=15.0; + var ConstrainedFloat v_constrainedFloat; + + + v_constrainedFloat:=v_float; + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_003.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44ce7a45c2327c6d6da549193a21b7fcb0327776 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_003.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_003 { + type charstring ConstrainedChar ("a" .. "z"); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_003() runs on GeneralComp { + + var charstring v_char := "j5l"; + var ConstrainedChar v_constrainedChar; + + v_constrainedChar:=v_char; // 5 not in dictionary + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_004.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..076bd7f5577b5a4af4a3cddeb41a9f263647861f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_004 { + type universal charstring ConstrainedUChar (char(0, 0, 1, 111) .. char(0, 0, 1, 113)); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_004() runs on GeneralComp { + + var universal charstring v_uChar := char(0, 0, 1, 122); + var ConstrainedUChar v_constrainedUChar; + + + v_constrainedUChar:=v_uChar; // char not in range + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_005.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01246e2a063574c5252528f4dc25b7743729dc55 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_005 { + type bitstring ConstrainedBitString ('01'B, '10'B, '11'B); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_005() runs on GeneralComp { + + var bitstring v_bitstr := '00'B; + var ConstrainedBitString v_constrainedBitstr; + + + v_constrainedBitstr:=v_bitstr; // value '00'B not in ConstrainedBitString type + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_006.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..283895d86b2c856f272733074dcfc3ab1cfba303 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_006.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from incompatible type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_006 { + type hexstring ConstrainedHexString ('1A'H, '1B'H, '1C'H); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_006() runs on GeneralComp { + + var hexstring v_hexstr := '2B'H; + var ConstrainedHexString v_constrainedHexstr; + + v_constrainedHexstr:=v_hexstr; // value '2B'H not in ConstrainedHexString type + +} + +control{ + execute(TC_NegSem_060301_non_structured_types_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_007.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..990aca278eb0678f57986080557ff939d8a6cb9c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_007.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_007 { + type integer ConstrainedInt[1]; + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_007() runs on GeneralComp { + + var integer v_int[2]:={5,4}; + var ConstrainedInt v_constrainedInt; + + + v_constrainedInt:=v_int; // length 2 array assigned to length 1 array type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_008.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c40cca04a89da76ec6d76916600d40c6d4568617 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_008.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_008 { + type float ConstrainedFloat[1]; + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_008() runs on GeneralComp { + + var integer v_float[2]:={5.0,4.0}; + var ConstrainedFloat v_constrainedFloat; + + + v_constrainedFloat:=v_float; // length 2 array assigned to length 1 array type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_009.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cb987046168609e29d9a52de9e76b76fac2dc8b9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_009.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_009 { + type charstring ConstrainedChar length (1); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_009() runs on GeneralComp { + + var charstring v_char := "jk"; + var ConstrainedChar v_constrainedChar; + + + v_constrainedChar:=v_char; // length 2 charstring assigned to length 1 type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_010.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..009bb31503aa07ee9047bcfa44888669af95509b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_010.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_010 { + type universal charstring ConstrainedUChar length (1); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_010() runs on GeneralComp { + + var universal charstring v_uChar := char(0, 0, 1, 112) & char(0, 0, 1, 112); + var ConstrainedUChar v_constrainedUChar; + + + v_constrainedUChar:=v_uChar; // length 2 charstring assigned to length 1 type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_010()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_011.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a85688aa18cc21b5d0e5f6bbbdd11c1043ea34e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_011.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_011 { + type bitstring ConstrainedBitString length (1); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_011() runs on GeneralComp { + + var bitstring v_bitstr := '10'B; + var ConstrainedBitString v_constrainedBitstr; + + + v_constrainedBitstr:=v_bitstr; // length 2 string assigned to length 1 type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_011()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_012.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce50bfc5e1f84704b888cf829e94666a6f6bd7bc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/NegSem_060301_non_structured_types_012.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060301_non_structured_types_012 { + type hexstring ConstrainedHexString length (1); + +type component GeneralComp { +} + +testcase TC_NegSem_060301_non_structured_types_012() runs on GeneralComp { + + var hexstring v_hexstr := '1B'H; + var ConstrainedHexString v_constrainedHexstr; + + v_constrainedHexstr:=v_hexstr; // length 2 string assigned to length 1 type +} + +control{ + execute(TC_NegSem_060301_non_structured_types_012()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4482bc90d1c177143ce7e7b56f39292085da0e26 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.2 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// integer and float assigments from compatible types. +module Sem_060301_non_structured_types_001 { + type integer ConstrainedInt(1..10); + type float ConstrainedFloat(1.0 .. 1E1); + +type component GeneralComp { +} + +testcase TC_Sem_060301_non_structured_types_001() runs on GeneralComp { + + var integer v_int:=5; + var ConstrainedInt v_constrainedInt; + var float v_float:=5.0; + var ConstrainedFloat v_constrainedFloat; + + + + v_constrainedInt:=v_int; + v_constrainedFloat:=v_float; + + + if ( + (v_constrainedInt==5) and + (v_constrainedFloat==5.0) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060301_non_structured_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4fc0b3b4a45ccfecf3729f52025c00ba76af65b2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_002.ttcn @@ -0,0 +1,74 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible size restrictions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060301_non_structured_types_002 { + type integer ConstrainedInt[1..2]; + type float ConstrainedFloat[1..2]; + type charstring ConstrainedChar length (1..2); + type universal charstring ConstrainedUChar length (1..2); + type bitstring ConstrainedBitString length (1..2); + type hexstring ConstrainedHexString length (1..2); + +type component GeneralComp { +} +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_060301_non_structured_types_002() runs on GeneralComp { + + var integer v_int[2]:={5,4}; + var ConstrainedInt v_constrainedInt; + var float v_float[2]:={5.0,4.0}; + var ConstrainedFloat v_constrainedFloat; + var charstring v_char := "jk"; + var ConstrainedChar v_constrainedChar; + var universal charstring v_uChar := char(0, 0, 1, 112); + var ConstrainedUChar v_constrainedUChar; + var bitstring v_bitstr := '10'B; + var ConstrainedBitString v_constrainedBitstr; + var hexstring v_hexstr := '1B'H; + var ConstrainedHexString v_constrainedHexstr; + + + v_constrainedInt:=v_int; + v_constrainedFloat:=v_float; + v_constrainedChar:=v_char; + v_constrainedUChar:=v_uChar; + v_constrainedBitstr:=v_bitstr; + v_constrainedHexstr:=v_hexstr; + + if ( + (v_constrainedInt[1]==5) and + (v_constrainedInt[2]==4) and + (f_isFloatNear(v_constrainedFloat[1],5.0)) and + (f_isFloatNear(v_constrainedFloat[2],4.0)) and + (v_constrainedChar=="jk") and + (v_constrainedUChar==char(0, 0, 1, 112)) and + (v_constrainedBitstr=='10'B) and + (v_constrainedHexstr=='1B'H) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060301_non_structured_types_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_003.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4fdd30bae7fc801c39d7e68db493f2e9ea4f1d43 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// charstring and universal charstring assigments +module Sem_060301_non_structured_types_003 { + + type charstring ConstrainedChar ("a" .. "z"); + type universal charstring ConstrainedUChar (char(0, 0, 1, 111) .. char(0, 0, 1, 113)); + + +type component GeneralComp { +} + +testcase TC_Sem_060301_non_structured_types_003() runs on GeneralComp { + + + var charstring v_char := "jkl"; + var ConstrainedChar v_constrainedChar; + var universal charstring v_uChar := char(0, 0, 1, 112); + var ConstrainedUChar v_constrainedUChar; + + + + v_constrainedChar:=v_char; + v_constrainedUChar:=v_uChar; + + if ( + (v_constrainedChar=="jkl") and + (v_constrainedUChar==char(0, 0, 1, 112))) + { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060301_non_structured_types_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_004.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7fbf05a2bcdbe7354cc2b7f9b7b41dde142a8dac --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060301_non-structured_types/Sem_060301_non_structured_types_004.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.1, Ensure that the IUT correctly handles assignments from compatible type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// bitstring and hexstring assignments + +module Sem_060301_non_structured_types_004 { + + type bitstring ConstrainedBitString ('01'B, '10'B, '11'B); + type hexstring ConstrainedHexString ('1A'H, '1B'H, '1C'H); + +type component GeneralComp { +} + +testcase TC_Sem_060301_non_structured_types_004() runs on GeneralComp { + + var bitstring v_bitstr := '10'B; + var ConstrainedBitString v_constrainedBitstr; + var hexstring v_hexstr := '1B'H; + var ConstrainedHexString v_constrainedHexstr; + + v_constrainedBitstr:=v_bitstr; + v_constrainedHexstr:=v_hexstr; + + if ( + (v_constrainedBitstr=='10'B) and + (v_constrainedHexstr=='1B'H) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060301_non_structured_types_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0403c598f5e589337a54374e68dce1846fb6f123 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2.1, Reject assignment of other enumerated types since they are only compatible to synonym types + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_001 { + + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedRedefinition {e_black, e_white}; + + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_001() runs on GeneralComp { + + var EnumeratedType v_enum1:=e_black; + var EnumeratedRedefinition v_enum2; + + v_enum2:=v_enum1; // not a synonym type + setverdict(pass); +} + +control{ + execute(TC_NegSem_060302_structured_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..829778e0c174a6255142ac4af9710998b05a0b7c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_002 { + + type record RecordType1 { + integer a(0..10) optional, + integer b(0..5) optional, + boolean c + } + type record RecordType2 { + integer e optional, + integer f(0..10) , + boolean g + } + + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_002() runs on GeneralComp { + + var RecordType1 v_rec1:={a:=4,b:=omit,c:=false}; + var RecordType2 v_rec2; + + v_rec2:=v_rec1; // optionality mismatch (e.g. b is optional where f is mandatory) + setverdict(pass); +} + +control{ + execute(TC_NegSem_060302_structured_types_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_003.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a044a7e6e1a261c19d66a9fad8c760f4cd69b857 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_003 { + + type record RecordType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + type record ModifiedRecord { + integer e optional, + integer f(0..5) optional, + boolean g + } + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_003() runs on GeneralComp { + + var ModifiedRecord v_rec1:={e:=15,f:=4,g:=false}; + var RecordType v_rec2; + + v_rec2:=v_rec1; //subtyping range mismatch + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_004.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2726cdc8e872978b757c3ca72b1c829650d8dcbf --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_004.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_004 { + + type set SetType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + type set ModifiedSet { + integer e optional, + integer f(0..5) , + boolean g + } + + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_004() runs on GeneralComp { + + var ModifiedSet v_set1:={f:=4,e:=8,g:=false}; + var SetType v_set2; + + v_set2:=v_set1; //optionality mismatch + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_005.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a5b860b328f7ee3d17b454aca192538b2b434df --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_005.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_005 { + + + type set SetType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + type set ModifiedSet { + integer e optional, + integer f(0..5) optional, + boolean g + } + + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_005() runs on GeneralComp { + + var ModifiedSet v_set1:={f:=4,e:=15,g:=false}; + var SetType v_set2; + + v_set2:=v_set1; //subtyping range mismatch + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_006.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea61c9b20677b251f4ab0f3679bc2d2031d982f9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_006.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_006 { + + + type record of integer IntegerList(0..10); + type record of integer ModifiedList; + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_006() runs on GeneralComp { + + var ModifiedList v_list1:={2,14,8}; + var IntegerList v_list2; + + v_list2:=v_list1; + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_007.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe9dd150197ac3be6619adc14582e0840add1a55 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_007.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_007 { + + + type set of integer IntegerUnorderedList(0..10); + type set of integer ModifiedUnorderedList; + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_007() runs on GeneralComp { + + var ModifiedUnorderedList v_ulist1:={2,14,8}; + var IntegerUnorderedList v_ulist2; + + v_ulist2:=v_ulist1; + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_008.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c2fcd7149142114148142cc387449dbe18c32a8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_008.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_008 { + + type enumerated EnumeratedType {e_black, e_white}; + type EnumeratedType EnumeratedSynonym; + + type union UnionType { + integer a(0..10), + EnumeratedType b, + boolean c + } + type union ModifiedUnion { + integer a, + boolean c, + EnumeratedSynonym b + } + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_008() runs on GeneralComp { + + var ModifiedUnion v_union1:={a:=12}; + var UnionType v_union2; + + v_union2:=v_union1; //subtyping range mismatch + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_009.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60a8d8558563fd3c89f3ee5b45f4e0a17dcfe392 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_009.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 409 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_009 language "TTCN-3:2016"{ + + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedRedefinition {e_black, e_white}; + + type union UnionType { + integer a(0..10), + EnumeratedType b, + boolean c + } + type union ModifiedUnion { + integer a, + boolean c, + EnumeratedRedefinition b + } + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_009() runs on GeneralComp { + + var ModifiedUnion v_union1:={b:=e_black}; + var UnionType v_union2; + + v_union2:=v_union1; //enumerated type mismatch + setverdict(pass); +} + +control{ + execute(TC_NegSem_060302_structured_types_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_010.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab64fe87cf6c8d7401eba8379b05a9604664a8a5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_010.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from incompatible types or type ranges + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_010 { + + type enumerated EnumeratedType {e_black, e_white}; + type EnumeratedType EnumeratedSynonym; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + type union ModifiedUnion { + integer aa, + boolean cc, + EnumeratedSynonym bb + } + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_010() runs on GeneralComp { + + var ModifiedUnion v_union1:={aa:=1}; + var UnionType v_union2; + + v_union2:=v_union1; //element naming mismatch + setverdict(pass); + +} + +control{ + execute(TC_NegSem_060302_structured_types_010()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_011.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c276250894cb346ab5332c7d34403393c9efb12c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_011.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments from structures having incompatible anytypes + ** @verdict pass reject + ***************************************************/ +module NegSem_060302_structured_types_011 { + + import from NegSem_060302_structured_types_011_importA all; + import from NegSem_060302_structured_types_011_importB all; + + +type component GeneralComp { +} + +testcase TC_NegSem_060302_structured_types_011() runs on GeneralComp { + + var NegSem_060302_structured_types_011_importA.Atype v_a; + var NegSem_060302_structured_types_011_importB.Atype v_b := { F := 1 } + + v_a:=v_b; //v_a's type does not contain the selected alternative + + if ( v_a==1 ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_060302_structured_types_011()); +} + +} + + +module NegSem_060302_structured_types_011_importA { + type integer I (0..2); + type anytype Atype; + } + + +module NegSem_060302_structured_types_011_importB { + type integer I (0..2); + type integer F; + type anytype Atype; +} + diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_012.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fcb1abd3b9e263174835c63779cfe443ef5877f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_012.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments having mismatch between undefined and omitted elements + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_012 { + + type record RecordType { + integer a, + integer b optional + } + + type set SetType { + integer a, + integer b optional + } + + type record length (1..2) of integer ShortIntegerList; + type record of integer IntegerList; + + type set length (1..2) of integer ShortUnorderedIntegerList; + type set of integer UnorderedIntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_012() runs on GeneralComp { + + + var IntegerList v_list1:={1,-}; + var ShortIntegerList v_list2; + var RecordType v_rec1; + var UnorderedIntegerList v_ulist1:={1,-}; + var ShortUnorderedIntegerList v_ulist2; + var SetType v_set1; + + var integer v_matcher[2] := {1,-}; + + var boolean v_check1; + + v_list2:=v_list1; + v_rec1:=v_list2; + v_ulist2:=v_ulist1; + v_set1:=v_ulist2; + + v_check1 := match(v_rec1, v_matcher); //mismatch between undefined and omitted elements + + } + + control{ + execute(TC_NegSem_060302_structured_types_012()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_013.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..559c93d3be346c444a2d7a902b8b165e3623e7a8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_013.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments having mismatch between undefined and omitted elements + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_013 { + + type record RecordType { + integer a, + integer b optional + } + + type set SetType { + integer a, + integer b optional + } + + type record length (1..2) of integer ShortIntegerList; + type record of integer IntegerList; + + type set length (1..2) of integer ShortUnorderedIntegerList; + type set of integer UnorderedIntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_013() runs on GeneralComp { + + + var IntegerList v_list1:={1,-}; + var ShortIntegerList v_list2; + var RecordType v_rec1; + var UnorderedIntegerList v_ulist1:={1,-}; + var ShortUnorderedIntegerList v_ulist2; + var SetType v_set1; + + var integer v_matcher[2] := {1,-}; + + var boolean v_check1; + + v_list2:=v_list1; + v_rec1:=v_list2; + v_ulist2:=v_ulist1; + v_set1:=v_ulist2; + + v_check1 := match(v_set1,{1,-}); //mismatch between undefined and omitted elements + + } + + control{ + execute(TC_NegSem_060302_structured_types_013()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_014.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78dcf29b88549ab545d41b2ca80125dc36b04fcf --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_014.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments between incompatible structures + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_014 { + + type record RecordType { + integer a, + integer b optional, + integer c + } + + type record of integer IntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_014() runs on GeneralComp { + + var RecordType v_record := { 1, omit, 2}; + var IntegerList v_IntList; + var integer v_array[2]; + + v_array:=v_record; //assignment between incompatible types + + } + + control{ + execute(TC_NegSem_060302_structured_types_014()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_015.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76840a5a725e5c96d22373ea1d45ff54a5c37dfe --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_015.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments between incompatible structures + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_015 { + + type record RecordType { + integer a, + integer b optional, + integer c + } + + type record of integer IntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_015() runs on GeneralComp { + + var RecordType v_record := { 1, omit, 2}; + var IntegerList v_IntList; + var integer v_array[2]; + + v_IntList:=v_record; //assignment between incompatible types + + } + + control{ + execute(TC_NegSem_060302_structured_types_015()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_016.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f07bdfc33c382d23bf02dc1fa8ecced6a74d9a3b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_016.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments between incompatible structures + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_016 { + + type set SetType { + integer a, + integer b optional, + integer c + } + + type set of integer IntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_016() runs on GeneralComp { + + var SetType v_set := { 1, omit, 2}; + var IntegerList v_IntList; + var integer v_array[2]; + + v_array:=v_set; //assignment between incompatible types + + } + + control{ + execute(TC_NegSem_060302_structured_types_016()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_017.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..786dfa573962a81fcb7c8fd5a4e3cec5ebf83dc9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_017.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments between incompatible structures + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_017 { + + type set SetType { + integer a, + integer b optional, + integer c + } + + type set of integer IntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_017() runs on GeneralComp { + + var SetType v_set := { 1, omit, 2}; + var IntegerList v_IntList; + var integer v_array[2]; + + v_IntList:=v_set; //assignment between incompatible types + + } + + control{ + execute(TC_NegSem_060302_structured_types_017()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_018.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d08044a8839cf84188d44624381da9b9e4d63bbb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_018.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT rejects assignments between incompatible structures + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_018 { + + type set SetType { + integer a, + integer b, + integer c + } + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_018() runs on GeneralComp { + + var SetType v_set := { 1, 2, 3}; + var integer v_array[3]; + + v_array:=v_set; //assignment between incompatible types, see clause G.9 compatibility rules + + } + + control{ + execute(TC_NegSem_060302_structured_types_018()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_019.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6425c5506e473ae10f3be5dcbd3668a15c4c240a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/NegSem_060302_structured_types_019.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and lengths + ** @verdict pass reject + ***************************************************/ + +module NegSem_060302_structured_types_019 { + + type record RecordType { + integer a, + integer b optional + } + + type set SetType { + integer a, + integer b optional + } + + type record length (1..2) of integer ShortIntegerList; + type record of integer IntegerList; + + type set length (1..2) of integer ShortUnorderedIntegerList; + type set of integer UnorderedIntegerList; + + + type component GeneralComp { + } + + testcase TC_NegSem_060302_structured_types_019() runs on GeneralComp { + + var IntegerList v_list1:={1,-}; + var ShortIntegerList v_list2; + var RecordType v_rec1; + var UnorderedIntegerList v_ulist1:={1,-}; + var ShortUnorderedIntegerList v_ulist2; + var SetType v_set1; + + var integer v_matcher[2] := {1,-}; + + var boolean v_check1; + + v_list2:=v_list1; + v_rec1:=v_list2; //incompatible assignment according to TTCN-3:2012 + v_ulist2:=v_ulist1; + v_set1:=v_ulist2; //incompatible assignment according to TTCN-3:2012 + + v_check1 := (v_list2[0]==1); + + + if ( v_check1 ) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_060302_structured_types_019()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ec1cb8947475139c63f584ec4242f1f1eeae10a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_001.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_001 { + + type enumerated EnumeratedType {e_black, e_white}; + type EnumeratedType EnumeratedSynonym; + + type record RecordType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + type record ModifiedRecord { + integer e optional, + integer f(0..5) optional, + boolean g + } + + type set SetType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + type set ModifiedSet { + integer e optional, + integer f(0..5) optional, + boolean g + } + + type record of integer IntegerList(0..10); + type record of integer ModifiedList; + + type set of integer IntegerUnorderedList(0..10); + type set of integer ModifiedUnorderedList; + + type union UnionType { + integer a(0..10), + EnumeratedType b, + boolean c + } + type union ModifiedUnion { + integer a, + boolean c, + EnumeratedSynonym b + } + + +type component GeneralComp { +} + +testcase TC_Sem_060302_structured_types_001() runs on GeneralComp { + + var EnumeratedType v_enum1:=e_black; + var EnumeratedSynonym v_enum2; + var ModifiedRecord v_rec1:={f:=4,e:=8,g:=false}; + var RecordType v_rec2; + var ModifiedSet v_set1:={f:=4,e:=8,g:=false}; + var SetType v_set2; + var ModifiedList v_list1:={2,4,8}; + var IntegerList v_list2; + var ModifiedUnorderedList v_ulist1:={2,4,8}; + var IntegerUnorderedList v_ulist2; + var ModifiedUnion v_union1:={a:=2}; + var UnionType v_union2; + + v_enum2:=v_enum1; + v_rec2:=v_rec1; + v_set2:=v_set1; + v_list2:=v_list1; + v_ulist2:=v_ulist1; + v_union2:=v_union1; + + if ( + (v_enum2==e_black) and + (v_rec2.a==8 and v_rec2.b==4 and v_rec2.c==false) and + (v_set2.a==8 and v_set2.b==4 and v_set2.c==false) and + (v_list2[0]==2 and v_list2[1]==4 and v_list2[2]==8) and + (v_ulist2[0]==2 and v_ulist2[1]==4 and v_ulist2[2]==8) and + (v_union2.a==2) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060302_structured_types_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fcbfb217ee8c249427928b3346d96bfb575aef0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_002.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 409 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and lengths + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_002 { + + type record RecordType { + integer a, + integer b optional + } + + type set SetType { + integer a, + integer b optional + } + + type record length (1..2) of integer ShortIntegerList; + type record of integer IntegerList; + + type set length (1..2) of integer ShortUnorderedIntegerList; + type set of integer UnorderedIntegerList; + + + type component GeneralComp { + } + + testcase TC_Sem_060302_structured_types_002() runs on GeneralComp { + + var IntegerList v_list1:={1,-}; + var ShortIntegerList v_list2; + var UnorderedIntegerList v_ulist1:={1,-}; + var ShortUnorderedIntegerList v_ulist2; + + var integer v_matcher[2] := {1,-}; + + var boolean v_check; + + v_list2:=v_list1; + v_ulist2:=v_ulist1; + + v_check := (v_list2[0]==1); + + + if ( v_check ) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_060302_structured_types_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_003.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f37260711295e0ccd72aac0989e460907205f4f9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_003.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_003 { + + + type record RecordType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + + type set SetType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + + + +type component GeneralComp { +} + +testcase TC_Sem_060302_structured_types_003() runs on GeneralComp { + + var RecordType v_rec1:={a:=4,b:=8,c:=false}; + var SetType v_set1; + + v_set1.a:=v_rec1.a; + v_set1.b:=v_rec1.b; + v_set1.c:=v_rec1.c; + + if ( + v_set1.a==4 and v_set1.b==8 and v_set1.c==false + ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060302_structured_types_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_004.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e5590f7d74e80781725325acb8f94629bacab41 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_004.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible anytypes + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_004 { + + import from Sem_060302_structured_types_004_importA all; + import from Sem_060302_structured_types_004_importB all; + + +type component GeneralComp { +} + +testcase TC_Sem_060302_structured_types_004() runs on GeneralComp { + + var Sem_060302_structured_types_004_importA.Atype v_a; + var Sem_060302_structured_types_004_importB.Atype v_b := { integer := 1 } + + v_a:=v_b; + + if ( match(v_a.integer, 1) ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060302_structured_types_004()); +} + +} + + +module Sem_060302_structured_types_004_importA { + type integer I (0..2); + type float F; + type anytype Atype; + } + + +module Sem_060302_structured_types_004_importB { + type integer I (0..2); + type anytype Atype; +} + diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_005.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a94bb3f5bbbbfe8b0127c51aeb2b3c0e9d236f94 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_005.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and type ranges + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_005 { + + + type record RecordType { + integer a(0..10) optional, + integer b(0..10) optional, + boolean c + } + + type record of RecordType RecordList; + + + +type component GeneralComp { +} + +testcase TC_Sem_060302_structured_types_005() runs on GeneralComp { + + var RecordList v_list; + var RecordType v_record:={a:=1,b:=2,c:=false}; + var integer v_int; + + + v_list:= {v_record,v_record}; + v_int:=v_list[1].b; + + if ( v_int==2 ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_060302_structured_types_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_006.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9395986c9c9fb491b99ef88673e92e236e84fc0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060302_structured_types/Sem_060302_structured_types_006.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:6.3.2, Ensure that the IUT correctly handles assignments from structures having compatible types and lengths + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060302_structured_types_006 { + + type record RecordType { + integer a, + integer b optional + } + + type set SetType { + integer a, + integer b optional + } + + type record length (1..2) of integer ShortIntegerList; + type record of integer IntegerList; + + type set length (1..2) of integer ShortUnorderedIntegerList; + type set of integer UnorderedIntegerList; + + + type component GeneralComp { + } + + testcase TC_Sem_060302_structured_types_006() runs on GeneralComp { + + var IntegerList v_list1:={0,-}; + var ShortIntegerList v_list2; + var RecordType v_rec1; + var UnorderedIntegerList v_ulist1:={1,-}; + var ShortUnorderedIntegerList v_ulist2; + var SetType v_set1; + + var integer v_matcher[2] := {1,-}; + + var boolean v_check1; + + v_list1:=v_matcher; + v_list2:=v_list1; + + + v_check1 := (v_list2[0]==1); + + if ( v_check1 ) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_060302_structured_types_006()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07ff5ecb18f17e38059e91c69684440dd261cd8a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.3, Ensure that the IUT correctly handles component incompatibility due to differing list of constant definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_060303_component_types_001 { + + type integer ConstrainedInteger(0..10); + + type component TestCaseComp { + const integer c_integer:=2; + } + + type component FunctionComp { + const integer c_integer:=2; + const ConstrainedInteger c_constrained:=2; + } + + function f_testFunction(integer p_arg) runs on FunctionComp return integer { + + var integer v_result; + v_result:=p_arg*c_integer; + return v_result; + } + + testcase TC_NegSem_060303_component_types_001() runs on TestCaseComp { + + var integer v_int:=1; + + v_int := f_testFunction(v_int); + // runs on mtc with type TestCaseComp + // f_testFunction needs to run on FunctionComp + // which has 2 variables not 1 as TestCaseComp + setverdict (fail, "ERROR expected: function runs on mtc with type TestCaseComp f_testFunction needs to run on FunctionComp which has 2 variables not 1 as TestCaseComp"); + } + + control { + execute(TC_NegSem_060303_component_types_001()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f29164525237b518ee7f4b86747f0c0e1fe33e67 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/NegSem_060303_component_types_002.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.3, Ensure that the IUT correctly handles component incompatibility due to differing constant types having same name + ** @verdict pass reject + ***************************************************/ + +module NegSem_060303_component_types_002 { + + type integer ConstrainedInteger(0..10); + + type component TestCaseComp { + const integer c_integer:=2; + const integer c_constrained:=2; + } + + type component FunctionComp { + const integer c_integer:=2; + const ConstrainedInteger c_constrained:=2; + } + + function f_testFunction(integer p_arg) runs on FunctionComp return integer { + + var integer v_result; + v_result:=p_arg*c_integer; + return v_result; + } + + testcase TC_NegSem_060303_component_types_002() runs on TestCaseComp { + + var integer v_int:=1; + + f_testFunction(v_int); + + setverdict(fail, "Error expected: as component types are not compatible since their definitions are not identical."); + } + + control { + execute(TC_NegSem_060303_component_types_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..853a71cfba277d1f690148bc4d0353d5f51b86b5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.3, Ensure that the IUT correctly handles assignments from structures having compatible components + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060303_component_types_001 { + + type integer ConstrainedInteger(0..10); + + type component TestCaseComp { + const integer c_integer:=2; + const ConstrainedInteger c_constrained:=2; + } + + type component FunctionComp { + const integer c_integer:=2; + const ConstrainedInteger c_constrained:=2; + } + + function f_testFunction(integer p_arg) runs on FunctionComp return integer { + + var integer v_result; + v_result:=p_arg*c_integer*c_constrained; + return v_result; + } + + testcase TC_Sem_060303_component_types_001() runs on TestCaseComp { + + var integer v_int:=1; + + if ( f_testFunction(v_int)==4 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060303_component_types_001()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87ba200b25ad6c6d75bb6aeaff26f02d4aee17f6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060303_component_types/Sem_060303_component_types_002.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:6.3.3, Ensure that the IUT correctly handles assignments from structures having compatible components + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_060303_component_types_002 { + + type integer ConstrainedInteger(0..10); + + type component TestCaseComp { + const integer c_integer:=2; + const ConstrainedInteger c_constrained:=2; + } + + type component FunctionComp { + const integer c_integer:=2; + } + + function f_testFunction(integer p_arg) runs on FunctionComp return integer { + + var integer v_result; + v_result:=p_arg*c_integer; + return v_result; + } + + testcase TC_Sem_060303_component_types_002() runs on TestCaseComp { + + var integer v_int:=2; + + if ( f_testFunction(v_int)==4 ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_060303_component_types_002()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9f29231d9659df848f3ae088c1256895396905a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.3.4, compatible but not strongly typed value in send operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The communication operations (see clause 22) send, receive, trigger, call, getcall, +// reply, getreply and raise and connection operations connect, map, disconnect and +// unmap (see clause 21.1) are exceptions to the weaker rule of type compatibility +// and require strong typing. The types of values or templates directly used as +// parameters to these operations shall also be explicitly defined in the associated +// port type definition. + +module NegSem_060304_compatibility_of_communication_operations_001 +{ + type port P message { + inout charstring; + } + + type component GeneralComp { + port P p; + } + + type charstring MyString; // synonym + + testcase TC_NegSem_060304_compatibility_of_communication_operations_001() runs on GeneralComp { + p.send(MyString:"abc"); + setverdict(pass); + } + + control { + execute(TC_NegSem_060304_compatibility_of_communication_operations_001()); + } +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c3d1e7184caf517ed8d387e2f9d690b6f5b12deb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.3.4, compatible but not strongly typed value in receive operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The communication operations (see clause 22) send, receive, trigger, call, getcall, +// reply, getreply and raise and connection operations connect, map, disconnect and +// unmap (see clause 21.1) are exceptions to the weaker rule of type compatibility +// and require strong typing. The types of values or templates directly used as +// parameters to these operations shall also be explicitly defined in the associated +// port type definition. + +module NegSem_060304_compatibility_of_communication_operations_002 +{ + type port P message { + inout charstring; + } + + type component GeneralComp { + port P p; + } + + type charstring MyString; // synonym + + testcase TC_NegSem_060304_compatibility_of_communication_operations_002() runs on GeneralComp { + p.send(charstring:"abc"); + alt { + []p.receive(MyString:?) {} + []p.receive {} // to avoid alt error in case the previous statement is incorrectly accepted + } + setverdict(pass); + } + + control { + execute(TC_NegSem_060304_compatibility_of_communication_operations_002()); + } +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_003.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6674350ab341e9c127358176e0ba946980d023cf --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_003.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.3.4, compatible but not strongly typed value in raise operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The communication operations (see clause 22) send, receive, trigger, call, getcall, +// reply, getreply and raise and connection operations connect, map, disconnect and +// unmap (see clause 21.1) are exceptions to the weaker rule of type compatibility +// and require strong typing. The types of values or templates directly used as +// parameters to these operations shall also be explicitly defined in the associated +// port type definition. + +module NegSem_060304_compatibility_of_communication_operations_003 +{ + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type charstring MyString; // synonym + + function f_mirror() runs on GeneralComp { + p.getcall(S:?); + p.raise(S, MyString:"abc"); + } + + testcase TC_NegSem_060304_compatibility_of_communication_operations_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_mirror()); + p.call(S:{}) { + [] p.catch {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_060304_compatibility_of_communication_operations_003()); + } +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_004.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..337039d3c6b5e57d3bb448a18212d54254a30997 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_004.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.3.4, compatible but not strongly typed value in raise operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The communication operations (see clause 22) send, receive, trigger, call, getcall, +// reply, getreply and raise and connection operations connect, map, disconnect and +// unmap (see clause 21.1) are exceptions to the weaker rule of type compatibility +// and require strong typing. The types of values or templates directly used as +// parameters to these operations shall also be explicitly defined in the associated +// port type definition. + +module NegSem_060304_compatibility_of_communication_operations_004 +{ + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type charstring MyString; // synonym + + function f_mirror() runs on GeneralComp { + p.getcall(S:?); + p.raise(S, "abc"); + } + + testcase TC_NegSem_060304_compatibility_of_communication_operations_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_mirror()); + p.call(S:{}) { + [] p.catch(S, MyString:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_060304_compatibility_of_communication_operations_003()); + } +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_005.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9fe30e063d742ad4129e4f2dd448f5cf3f3fb352 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060304_compatibility_of_communication_operations/NegSem_060304_compatibility_of_communication_operations_005.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:6.3.4, compatible but not strongly typed value in trigger operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The communication operations (see clause 22) send, receive, trigger, call, getcall, +// reply, getreply and raise and connection operations connect, map, disconnect and +// unmap (see clause 21.1) are exceptions to the weaker rule of type compatibility +// and require strong typing. The types of values or templates directly used as +// parameters to these operations shall also be explicitly defined in the associated +// port type definition. + +module NegSem_060304_compatibility_of_communication_operations_005 +{ + type port P message { + inout charstring; + } + + type component GeneralComp { + port P p; + } + + type charstring MyString; // synonym + + testcase TC_NegSem_060304_compatibility_of_communication_operations_005() runs on GeneralComp { + timer t := 2.0; + t.start; + p.send(charstring:"abc"); + alt { + []p.trigger(MyString:?) {} + []t.timeout {} // to avoid endless blocking in case the previous statement is incorrectly accepted + } + setverdict(pass); + } + + control { + execute(TC_NegSem_060304_compatibility_of_communication_operations_005()); + } +} diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/NegSem_060305_compatibility_of_anytype_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/NegSem_060305_compatibility_of_anytype_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dca199abfdfce0beab115e88b2912c16d7aef2a1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/NegSem_060305_compatibility_of_anytype_types_001.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.3.0.6, ensure that anytype types are only compatible with other anytype types. + ** @verdict pass reject + ***************************************************/ + +/*The following requirement is tested: + * Only anytype types that are constrained to a fixed set of types via list subtyping + * can be a potential cause for anytype incompatibility, i.e. if the set of types contained + * in type "B" does not contain the type selected in "a". +*/ + +module NegSem_060305_compatibility_of_anytype_types_001 { + + import from NegSem_060305_compatibility_of_anytype_types_001_importB all; + import from NegSem_060305_compatibility_of_anytype_types_001_importC all; + + type integer I (0..9); + type charstring C; + type anytype Btype ({float:=?},{integer:=?}); + + type component GeneralComp { +} + + +testcase TC_NegSem_060305_compatibility_of_anytype_types_001() runs on GeneralComp { + + var NegSem_060305_compatibility_of_anytype_types_001_importB.Atype v_aa; + var Atype v_baI := { NegSem_060305_compatibility_of_anytype_types_001_importC.I := 1 }; + + v_aa := v_baI; // incorrect + setverdict(pass); +} + +control { + execute(TC_NegSem_060305_compatibility_of_anytype_types_001()); +} + +} + + +module NegSem_060305_compatibility_of_anytype_types_001_importB { + type integer I (0..2); + type anytype Atype ({I:=?},{integer:=?},{float:=?}); +} + +module NegSem_060305_compatibility_of_anytype_types_001_importC { + type integer I (0..2); + type float F; + type anytype Atype ({I:=?},{F:=?},{integer:=?}); + } \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_001.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..caaa98458a94d2aee5f58759e5e3846a80aab789 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.3.0.6, ensure that anytype types are only compatible with other anytype types. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * An anytype value "a" of anytype type "A" is compatible with anytype type "B" + * if the alternative selected in "a"is also contained in "B". +*/ + +module Sem_060305_compatibility_of_anytype_types_001 { + type integer I (0..9); + type charstring C; + type anytype Atype ({I:=?},{C:=?},{integer:=?}); + type anytype Btype ({float:=?},{I:=?}); + + type component GeneralComp { +} + + +testcase TC_Sem_060305_compatibility_of_anytype_types_001() runs on GeneralComp { + var Atype v_x; + var Btype v_y; + v_x.I := 8; + v_y.I := 8; + + + if (match(v_x,v_y)) { + setverdict(pass); + } + else { + setverdict(fail,v_x,v_y); + } + +} + +control { + execute(TC_Sem_060305_compatibility_of_anytype_types_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_002.ttcn b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71f40aa7499ba843a4796ec3a561592c6cfa8dfc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0603_type_compatibility/060305_compatibility_of_anytype_types/Sem_060305_compatibility_of_anytype_types_002.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:5.3.0.6, ensure that anytype types are only compatible with other anytype types. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*The following requirement is tested: + * An anytype value "a" of anytype type "A" is compatible with anytype type "B" + * if the alternative selected in "a"is also contained in "B". +*/ + +module Sem_060305_compatibility_of_anytype_types_002 { + type integer I (0..9); + type charstring C; + type anytype Atype ({I:=?},{C:=?},{integer:=?}); + type anytype Btype ({float:=?},{integer:=?}); + + type component GeneralComp { +} + + +testcase TC_Sem_060305_compatibility_of_anytype_types_002() runs on GeneralComp { + var Atype v_x; + var Btype v_y; + v_x.I := 8; + v_y.integer := 8; + + + if (match(v_x.I,8) and match(v_y.integer,8) and v_x != v_y) { + setverdict(pass); + } + else { + setverdict(fail,v_x,v_y); + } + +} + +control { + execute(TC_Sem_060305_compatibility_of_anytype_types_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/06_types_and_values/0604_type_synonym/NOTES b/ATS/core_language/06_types_and_values/0604_type_synonym/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..2273c7252fb387c73b59ce56b7d64c0f3cd9879a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0604_type_synonym/NOTES @@ -0,0 +1 @@ +- NOTE: rules involving synonyms have already been tested as part of section 6.3. \ No newline at end of file diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NOTES b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..41d4a644c8815e83ffa9e2c145a1950168f548c0 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NOTES @@ -0,0 +1,2 @@ +- TODO: operator precedence not yet part of the tests. +- TODO: no negative tests. \ No newline at end of file diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8eb4a28115940d341e866b32b410fb4aa44a6b4 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that Arithmetic operators are for integer and float values + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_001() runs on GeneralComp { + var integer v_i := 20; + var boolean v_k :=true; + + var integer v_result := v_i*v_k; // not allowed int*boolean + + setverdict(pass); + + +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d504b5bd7b1390c4381c83975eab6e13caefe71a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_002.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle same type of variables + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_002 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_002() runs on GeneralComp { + var integer v_i := 20; + var float v_k :=2.0E0; + + var integer v_result := v_i*v_k; // not allowed int*float + + setverdict(pass); + +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..389a0de3d13c62206234c7f669ee8b9d349dabea --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_003.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that mod arithmetic operator can handle integer variables + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_003 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_003() runs on GeneralComp { + var float v_i := 2.0E1; + var float v_k :=2.0E0; + + var integer v_result := v_i mod v_k; // mod operator is only for integer type + + setverdict(pass); +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc6ce581260bf60d58f709f6bc50b156102d5c34 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_004.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that rem arithmetic operator can handle integer variables + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_004 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_004() runs on GeneralComp { + var float v_i := 2.0E1; + var float v_k :=2.0E0; + + var integer v_result := v_i rem v_k; // rem operator is only for integer type + + setverdict(pass); +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_008.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de2525ff1a8db9ec0bd981b21cde5e94b3ec8bad --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_008.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that in x mod y arithmetic operator y is non-zero positive number + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_008 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_008() runs on GeneralComp { + var integer v_i := 20; + var integer v_k :=0; + + var integer v_result := v_i mod v_k; // arithmetic operator mod with 0 is not allowed + + setverdict(pass); + +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_008()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_009.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08b71b0c5bf3ce8df89344f3620244880b25f42c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_009.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that in x rem y arithmetic operator y is non-zero positive number + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_009 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_009() runs on GeneralComp { + var integer v_i := 20; + var integer v_k :=0; + + var integer v_result := v_i rem v_k; // arithmetic operator rem with 0 is not allowed + + setverdict(pass); + +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_009()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_010.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab811790cfbc4823eec3ed0cc1ef79baae6a3b5a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/NegSem_070101_ArithmeticOperators_010.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that in x rem y arithmetic operator y is non-zero positive number + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070101_ArithmeticOperators_010 { + +type component GeneralComp { +} + +testcase TC_NegSem_070101_ArithmeticOperators_010() runs on GeneralComp { + var integer v_i := 20; + var integer v_k :=4; + var integer v_l :=2; + + var integer v_result := v_i rem (v_k mod v_l); // arithmetic operator rem with 0 is not allowed + + setverdict(pass); + +} +control{ + execute(TC_NegSem_070101_ArithmeticOperators_010()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8579ce7f9e8cd33a3d341c063638f3c8f0fc6d8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition of two integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_001() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_result := v_i + v_j; + + if (v_result == 12) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f56db469da83cb17077bd42866a1a17b07bd0dad --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition of multiple integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_002() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_k := 4; + var integer v_l := 6; + var integer v_result := v_i + v_j + v_k + v_l; + + if (v_result == 22) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab9cdd5d2a612482e12032404e3fb161908b3c2a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_003.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition of two integer variables is evaluated correctly when the expression contains a negative value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_003 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_003() runs on GeneralComp { + var integer v_i := -10; + var integer v_j := 2; + var integer v_result := v_i + v_j; + + if (v_result == -8) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd09e72dd6c00c2af63e63e92be06f5d23db6ad9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_004.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the substraction of two integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_004 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_004() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_result := v_i - v_j; + + if (v_result == 8) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_005.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39cbe4cf60d3728e4573021eb694d699f0e3290d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_005.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the substraction of multiple integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_005 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_005() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_k := 12; + var integer v_result := v_i - v_j - v_k; + + if (v_result == -4) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_005()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_006.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd8e7949d6f95c8ccbd75657e35aa5fe5edd38b1 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_006.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the multiplication of two integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_006 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_006() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_result := v_i * v_j; + + if (v_result == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_006()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_007.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36826b9643bb0a012c4fce2ddf996d068cf38fe5 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_007.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the multiplication of multiple integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_007 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_007() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_k := 4; + var integer v_l := 3; + var integer v_result := v_i * v_j * v_k * v_l; + + if (v_result == 240) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_007()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_008.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3d113a3d7178f5edeb867c737c5158f7782b004 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_008.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the division of two integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_008 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_008() runs on GeneralComp { + var integer v_i := 10; + var integer v_j := 2; + var integer v_result := v_i / v_j; + + if (v_result == 5) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_008()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_009.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12a12b8b5b0b3bda0113fb6354d56b75fe4c8b56 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_009.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the division of multiple integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_009 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_009() runs on GeneralComp { + var integer v_i := 100; + var integer v_j := 4; + var integer v_k := 5; + var integer v_result := v_i / v_j / v_k; + + if (v_result == 5) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_009()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_010.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1e703f57138e794d679286f5b368b890b0195f4 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_010.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the modulo operator on integer variables is evaluated correctly when the remainder is zero. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_010 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_010() runs on GeneralComp { + var integer v_i := 4; + var integer v_result := v_i mod 2; + + if (v_result == 0) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_010()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_011.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17c5e31c16da30ee54964356612675cc39c5a7c6 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_011.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the modulo operator on integer variables is evaluated correctly when the integer value is smaller than the modulo value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_011 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_011() runs on GeneralComp { + var integer v_i := 8; + var integer v_result := v_i mod 10; + + if (v_result == 8) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_011()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_012.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80b5d0f572bd677a8e6b686410993959bddd5ab0 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_012.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the modulo operator on integer variables is evaluated correctly when the integer value greater than the modulo value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_012 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_012() runs on GeneralComp { + var integer v_i := 12; + var integer v_result := v_i mod 10; + + if (v_result == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_012()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_013.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06675311614b0fef23a0be6be77387cf95185e04 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_013.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the modulo operator on integer variables is evaluated correctly when two consecutive modulo operators are applied. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_013 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_013() runs on GeneralComp { + var integer v_i := 11; + var integer v_result := (v_i mod 6) mod 3; + + if (v_result == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_013()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_014.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a617b2aedd305cadd2e4fc696c6c5ffaa186a519 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_014.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the modulo operator on integer variables is evaluated correctly when the operand is a negative integer. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_014 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_014() runs on GeneralComp { + var integer v_i := -2; + var integer v_result := (v_i mod 3); + + if (v_result == 1) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_014()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_015.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27cf6dae6663baec52b9120538b194c52ef128b3 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_015.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the remainder operator on integer variables is evaluated correctly when the operand is a negative integer. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_015 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_015() runs on GeneralComp { + var integer v_i := -2; + var integer v_result := (v_i rem 3); + + if (v_result == -2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_015()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_016.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d6a927089b9b7a1a6b00a9c36d05026fdebdb83 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_016.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the application of the remainder operator on integer variables is evaluated correctly when the operand is a negative integer. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_016 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_016() runs on GeneralComp { + var integer v_i := 2; + var integer v_result := (v_i rem 3); + + if (v_result == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_016()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_017.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..135d06572cb30e1195470cac3c15470dab5c13c9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_017.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the consecutive application of the remainder operator and the modulo operator on integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_017 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_017() runs on GeneralComp { + var integer v_i := -2; + var integer v_result := (v_i rem 3) mod 3; + + if (v_result == 1) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_017()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_018.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bce54ac3d872925ea3ba463d001598e9b737869b --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_018.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that operator combinations and the modulo operator on integer variables is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_018 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_018() runs on GeneralComp { + var integer v_i := 100; + var integer v_result := (((((v_i mod 75)/5)*2)+10)-22) rem 3; + + if (v_result == -2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_018()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_019.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f59d8be3c2862b223d6ea800a72225dfe7bb0a45 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_019.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition operator works on float variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_019 { + +type component GeneralComp { +} + +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_070101_ArithmeticOperators_019() runs on GeneralComp { + var float v_i := 10.2; + var float v_j := 0.4; + var float v_result := v_i + v_j; + + if ( f_isFloatNear(v_result,10.6) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_019()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_020.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..027c3ac0279410061e71a304fbece552d2938ebf --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_020.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the substraction operator works on float variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_020 { + +type component GeneralComp { +} + +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_070101_ArithmeticOperators_020() runs on GeneralComp { + var float v_i := 10.2; + var float v_j := 0.4; + var float v_result := v_i - v_j; + + if ( f_isFloatNear(v_result,9.8) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_020()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_021.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9216eef7f98dcc014be68a83f099a42aeb2205e --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_021.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the multiplication operator works on float variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_021 { + +type component GeneralComp { +} + +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_070101_ArithmeticOperators_021() runs on GeneralComp { + var float v_i := 10.2; + var float v_j := 0.4; + var float v_result := v_i * v_j; + + if ( f_isFloatNear(v_result,4.08) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_021()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_022.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28c8b4177f9636c905d760893436f4b0c1a0c671 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_022.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the division operator works on float variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_022 { + +type component GeneralComp { +} + +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_070101_ArithmeticOperators_022() runs on GeneralComp { + var float v_i := 10.2; + var float v_j := 0.4; + var float v_result := v_i / v_j; + + if ( f_isFloatNear(v_result,25.5) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_022()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_023.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab96edb0055e14dd0d4435ec9654cacec6698b06 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_023.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the combination of different operators works on float variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_023 { + +type component GeneralComp { +} + +/** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ +function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; +} + +testcase TC_Sem_070101_ArithmeticOperators_023() runs on GeneralComp { + var float v_i := 10.2; + var float v_result := (((v_i * 2.3) / 0.4)+0.45)-0.1; + + if ( f_isFloatNear(v_result,59.0) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_023()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_024.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5913cd7d9b59c4e9ff5519046ccd3891622dd711 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_024.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the operator precedence is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_024 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_024() runs on GeneralComp { + var integer v_i := 4; + var integer v_j := 12; + var integer v_k := 18; + var integer v_l := 3; + + var integer v_result := v_i+v_j-v_k / v_l; + + if (v_result == 10) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_024()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_025.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed4331cef33e7af81e7c212cc96e48f638dda920 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_025.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the operator precedence is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_025 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_025() runs on GeneralComp { + var integer v_i0 := 20; + var integer v_i1 := 16; + var integer v_i2 := 2; + var integer v_j := 4; + var integer v_k := 8; + + var integer v_result := v_i0 rem 3-v_j+v_i1/v_i2 mod 3*v_k; + + if (v_result == 14) { + setverdict(pass); + } else { + setverdict(fail); + } +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_025()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_026.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2363462283b2cbb878e96b37da9751d2d1a2cc47 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_026.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the operator precedence is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_026 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_026() runs on GeneralComp { + var integer v_i0 := 40; + var integer v_i1 := 6; + var integer v_i2 := 3; + + var integer v_result := v_i0 rem v_i1 mod v_i2; // equal precendence, then left-right evalution + + if (v_result == 1) { + setverdict(pass); + } else { + setverdict(fail); + } +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_026()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_027.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e0346ea7ef0ad84dccad320193a62c3e99410fd2 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_027.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_027 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_027() runs on GeneralComp { + var float v_i := infinity; + var float v_k :=2.0E0; + + var float v_result := v_i + v_k; // "+" arithmetic operator with infinity + + if (v_result == infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_027()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_028.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf350fd93597e02516133640ac2065806f9430e1 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_028.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_028 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_028() runs on GeneralComp { + var float v_i := infinity; + var float v_k :=2.0E0; + + var float v_result := v_i - v_k; // "-" arithmetic operator with infinity + + if (v_result == infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_028()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_029.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..045a95aaa6ece4b048deb4eff2137948126211e9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_029.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_029 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_029() runs on GeneralComp { + var float v_i := infinity; + var float v_k :=2.0E0; + + var float v_result := v_i * v_k; // "*" arithmetic operator with infinity + + if (v_result == infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_029()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_030.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..160b6214f711787d275769eb04315763326401ef --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_030.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_030 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_030() runs on GeneralComp { + var float v_i := infinity; + var float v_k :=2.0E0; + + var float v_result := v_i / v_k; // "/" arithmetic operator with infinity + + if (v_result == infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_030()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_031.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a5dfc227d8ae0a78dcef22c46122ebae6e25811 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_031.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_031 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_031() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_i + v_k; // "+" arithmetic operator with -infinity + + if (v_result == -infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_031()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_032.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..814d1be788b2166ee500bbc53e8f0a8e2b106223 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_032.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_032 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_032() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_i - v_k; // "-" arithmetic operator with -infinity + + if (v_result == -infinity) { setverdict(pass,"match") } + else { setverdict(fail, v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_032()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_033.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dad688a4b6bc61dfe1ed451ae5a6d9206583f774 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_033.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_033 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_033() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_i * v_k; // "*" arithmetic operator with -infinity + + if (v_result == -infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_033()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_034.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6d19498ea3eb4003e364ec68b61d51e004f34b8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_034.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_034 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_034() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_i / v_k; // "/" arithmetic operator with -infinity + + if (v_result == -infinity) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_034()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_035.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0927721f23390fcd9e1efd64a69f0edfe817fdf --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_035.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_035 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_035() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=2.0E0; + + var float v_result := v_i + v_k; // "+" arithmetic operator with NaN + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_035()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_036.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..726bf9ba2ba3a84b5b15bb4d1e1c7c5e451c7a33 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_036.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_036 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_036() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=2.0E0; + + var float v_result := v_i - v_k; // "-" arithmetic operator with NaN + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_036()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_037.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75d7939c6cee2272601dcdb0d453f3fd5fb21623 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_037.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_037 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_037() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=2.0E0; + + var float v_result := v_i * v_k; // "*" arithmetic operator with NaN + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_037()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_038.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a332d3028b83057b2029a68406d996ad93a7c3c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_038.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_038 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_038() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=2.0E0; + + var float v_result := v_i / v_k; // "/" arithmetic operator with NaN + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_038()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_039.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2fb0a72f427f3edbb211b240e5d2964be58679d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_039.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + + +module Sem_070101_ArithmeticOperators_039 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_039() runs on GeneralComp { + var float v_i := infinity; + var float v_k :=2.0E0; + + var float v_result := v_k / v_i; // Infinity special float as denominator + + if (v_result == 0.0) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_039()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_040.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ede1b13562b261109f2866fd21502028bda3963e --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_040.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + + +module Sem_070101_ArithmeticOperators_040 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_040() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_k / v_i; // -Infinity special float as denominator + + if (v_result == 0.0) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_040()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_041.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58c5e996f02e724235363e720ed3b225bdc4771f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_041.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_041 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_041() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=2.0E0; + + var float v_result := v_k / v_i; // NaN special float as denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_041()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_042.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b16c375aa5b1ad39baf8ad5ba7a858e5a6c557b1 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_042.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_042 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_042() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k :=not_a_number; + + var float v_result := v_k / v_i; // NaN special float as nominator and denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_042()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_043.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0377bc19be6598abc9d700c973843687f88e859 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_043.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_043 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_043() runs on GeneralComp { + var float v_i := infinity; + var float v_k := infinity; + + var float v_result := v_k / v_i; // infinity special float as nominator and denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_043()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_044.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1013b3c2991e39431959f2e418f6e45d720382b1 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_044.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_044 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_044() runs on GeneralComp { + var float v_i := -infinity; + var float v_k := -infinity; + + var float v_result := v_k / v_i; // -infinity special float as nominator and denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_044()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_045.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..968ab694bbdd4af8b6d5fb47c6e17a5ef5139ffe --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_045.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_045 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_045() runs on GeneralComp { + var float v_i := infinity; + var float v_k := -infinity; + + var float v_result := v_k / v_i; // -infinity special float as nominator and infinity special float as denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_045()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_046.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..911e41813d1ed399ca8ec063d1e40c6eca94990f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_046.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_046 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_046() runs on GeneralComp { + var float v_i := -infinity; + var float v_k := infinity; + + var float v_result := v_k / v_i; // infinity special float as nominator and -infinity special float as denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_046()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_047.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98fafc8ee5cd443823fc479d8bbbf568a433bb96 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_047.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_047 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_047() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k := infinity; + + var float v_result := v_k / v_i; // infinity special float as nominator and NaN special float as denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_047()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_048.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e78fa3c2548808643bbd92c405b17cdbc95869d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_048.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_048 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_048() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k := -infinity; + + var float v_result := v_k / v_i; // -infinity special float as nominator and NaN special float as denominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_048()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_049.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f230efd661e2a29da9c8ce4d30f7fd2e0f76a3c9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_049.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_070101_ArithmeticOperators_049 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_049() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k := infinity; + + var float v_result := v_i / v_k; // infinity special float as denominator and NaN special float as nominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_049()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_050.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fbc970050703d2364dcc6ec4f0f58c696b9a5dc --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_050.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that arithmetic operators can handle special float values + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* Restriction c) With the exception of the equality and non-equality operators, the special value null shall not be used as an operand of expressions (see clause 7.1.3).*/ + +module Sem_070101_ArithmeticOperators_050 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_050() runs on GeneralComp { + var float v_i := not_a_number; + var float v_k := -infinity; + + var float v_result := v_i / v_k; // -infinity special float as denominator and NaN special float as nominator + + if (v_result == not_a_number) { setverdict(pass,"match") } + else { setverdict(fail,v_result) } + + +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_050()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_051.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37e4d506f16232a34140a14c84b75b68acb38c63 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_051.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equal to operator on address with value null is evaulated correctly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_051 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_Sem_070101_ArithmeticOperators_051() runs on GeneralComp { + + var address My_address := null; + + + if (My_address == null) + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_051()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_052.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd59515742c312ff1dd1b3d9fa7a888fef8f342c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_052.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not equal to operator on address with value null is evaulated correctly + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* Restriction c) With the exception of the equality and non-equality operators, the special value null shall not be used as an operand of expressions (see clause 7.1.3).*/ + + +module Sem_070101_ArithmeticOperators_052 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_Sem_070101_ArithmeticOperators_052() runs on GeneralComp { + + var address My_address := 1; + + + if (My_address != null) + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_Sem_070101_ArithmeticOperators_052()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_053.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4e8db7aab90cd181b2917022b7a3bc8d25b207a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Sem_070101_ArithmeticOperators_053.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 (updated by 521) + ** @version 0.0.1 + ** @purpose 1:7.1.1, verify that arithmetic operators can handle special float values according to the rules of IEEE 754 + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070101_ArithmeticOperators_053 { + +type component GeneralComp { +} + +testcase TC_Sem_070101_ArithmeticOperators_053() runs on GeneralComp { + var float v_i := -infinity; + var float v_k :=2.0E0; + + var float v_result := v_i * v_k; // arithmetic operator with -infinity is allowed by IEEE 754 + + if (v_result == -infinity) { setverdict(pass); } + else { setverdict(fail); } +} +control{ + execute(TC_Sem_070101_ArithmeticOperators_053()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db5a44cd29ff8f9ae1ae01a83cd4a8e3445ac296 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_001.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition of two integers in a constant is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_001 { + +const integer c_result := 10 + 2; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9ea11c3b3bf9fa6bb8a7307e05c13d1acbdcd71 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_002.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the substraction of two integers in a constant is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_002 { + +const integer c_result := 10 - 2; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e995a63abfb8be540dbb4b8d129d54af76901969 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_003.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the multiplication of two integers in a constant is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_003 { + +const integer c_result := 10 * 2; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57de7882d234567a31c66561bf324f16b3e29b43 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_004.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the division of two integers in a constant is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_004 { + +const integer c_result := 10 / 3; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_005.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7842643f2d05d13cd9da7101f83712240b7a459f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_005.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the modulo operator on two integers is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_005 { + +const integer c_result := 10 mod 3; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_006.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8478acf6695951aab34416d280a87e56c45be29f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_006.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the remainder operator on two integers is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_006 { + +const integer c_result := -2 rem 3; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_007.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..93d33e12ceaecd9baddf974785c7f4f4327d1c1d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_007.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that operator combinations on integers is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_007 { + +const integer c_result := (((((100 mod 75)/5)*2)+10)-22) rem 3; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_008.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd3e90f0609974374151999277373cadc2d73117 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_008.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the addition operator on float constants is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_008 { + +const float c_result := 10.2 + 0.4; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_009.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..245665a517a03601e742039c1990f32633f0d71d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_009.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the substraction operator on float constants is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_009 { + +const float c_result := 10.2 - 0.4; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_010.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5430cabb7352aa8912958627fd1c70af1c64cb7a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_010.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the multiplication operator on float constants is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_010 { + +const float c_result := 10.2 * 0.4; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_011.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5b5d8c9b6339291446ec6a058a8c608252c58cc --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_011.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that the division operator on float constants is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_011 { + +const float c_result := 10.2 / 0.4; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_012.ttcn b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ef5607621a5cd2bedbf13967ddb88dd6aaf98e3 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070101_arithmetic_operators/Syn_070101_ArithmeticOperators_012.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.1, Ensure that a combination of operators on float constants is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_070101_ArithmeticOperators_012 { + const float c_i := 1.5; + const float c_result := (((c_i * 2.3) / 0.4)+0.45)-0.1; + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce1b598547008844b475404379fc90098d688ff4 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on bitstrings is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070102_ListOperator_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070102_ListOperator_001() runs on GeneralComp { + var bitstring v_result := '1111'B & '0000'B & '1111'B; + if (v_result == '111100001111'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68c3f98a2a97c8dd97f33e9ab54d22c40a9429f2 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_002.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on charstrings is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070102_ListOperator_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070102_ListOperator_002() runs on GeneralComp { + var charstring v_result := "Hello" & " " & "World!"; + if (v_result == "Hello World!") { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e386da206b5a49d195f3f0d50672095d54a73dd5 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_003.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on record of is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_070102_ListOperator_003 { + +type component GeneralComp { +} + +type record of integer IntegerArray; + +testcase TC_Sem_070102_ListOperator_003() runs on GeneralComp { + var IntegerArray v_i := {0, 1, 2}; + var IntegerArray v_j := {3, 4, 5}; + + var IntegerArray v_result := v_i & v_j; + var IntegerArray v_reference := {0, 1, 2, 3, 4, 5}; + if (v_result == v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..232d2d15666d8362db37f48cc77311faa159c0a7 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_004.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on set of is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_070102_ListOperator_004 { + +type component GeneralComp { +} + +type set of integer IntegerSet; + +testcase TC_Sem_070102_ListOperator_004() runs on GeneralComp { + var IntegerSet v_i := {0, 1, 6}; + var IntegerSet v_j := {2, 4, 7}; + + var IntegerSet v_result := v_i & v_j; + var IntegerSet v_reference := {0, 1, 6, 2, 4, 7}; + if (v_result == v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_005.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60bb13e9ff5faf14bc285b61d068f8b46f13aa1a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_005.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on arrays is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070102_ListOperator_005 { + +type component GeneralComp { +} + +type integer MyArrayType[3]; +type integer MyArrayTypeSix[6]; + +testcase TC_Sem_070102_ListOperator_005() runs on GeneralComp { + var MyArrayType v_i := {0, 1, 6}; + var MyArrayType v_j := {2, 4, 7}; + + var MyArrayTypeSix v_result := v_i & v_j; + var MyArrayTypeSix v_reference := {0, 1, 6, 2, 4, 7}; //order of elements is concatenated order + if (v_result == v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_005()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_006.ttcn b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e778f8bbe41e561eb57bcfd5dc91db9fa47501fc --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070102_list_operator/Sem_070102_ListOperator_006.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.2, Ensure that the list operator on record of is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_070102_ListOperator_006 { + +type component GeneralComp { +} + +type record of integer IntegerArray; + +testcase TC_Sem_070102_ListOperator_006() runs on GeneralComp { + var IntegerArray v_i := {0, 1, 2} & {3, 4, 5} & {6}; + + var IntegerArray v_reference := {0, 1, 2, 3, 4, 5, 6}; + + if (v_i == v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070102_ListOperator_006()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NOTES b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..923ef02d2d2f339967c2aece9ef4c740358a3cff --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NOTES @@ -0,0 +1,4 @@ +TODO: add == and != tests for default (altstep activation variables). Try the following varieties, +based on 20.5 test cases: + if (v_def == null) ... + if (v_def1 == v_def2) ... \ No newline at end of file diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3fbcd889e72573501fa109e5960003fec003f7c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_001 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_NegSem_070103_RelationalOperators_001() runs on GeneralComp { + const IntegerSet c_set := {a1:=omit,a2:=2,a3:=omit}; + + if ( c_set.a1 == omit ) { //omit is neither a value nor a field reference + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57d86529219bddb316a4b6d8718ac5a849a49f81 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_002.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_002 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_002() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=omit}; + + if ( c_set1 & c_set2 == c_large ) { //It is intentionally forbidden to concatenate record and set values + setverdict(pass); + } + +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a43a461553f7edc0255c74b722ccdd929effbfb6 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_003.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ +//on hold till resolution of CR6707 + +module NegSem_070103_RelationalOperators_003 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_003() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=6}; + + if ( c_set1 & c_set2 != c_large ) { //It is intentionally forbidden to concatenate record and set values + setverdict(pass); + } + +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba0621b6509899aae279b86f2bf51f6e050d19db --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_004.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ +//on hold till resolution of CR6707 + +module NegSem_070103_RelationalOperators_004 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_004() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5}; + + if ( c_set1 & c_set2 != c_large ) { //It is intentionally forbidden to concatenate record and set values + setverdict(pass); + } + +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_005.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78bd48ca27ed11fd9c94d078f71f4f71f53e49c2 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not equal to operator on address can not be evaluated if value is uninitialized. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_005 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_NegSem_070103_RelationalOperators_005() runs on GeneralComp { + + var address My_address; //uninitialized address type value + + + if (My_address != null) //error + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_005()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_006.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78cc9883734a241e1c278f448fc0184401ea24d4 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_006.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that concatenation mismatch is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_006 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_006() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=omit}; + + if ( c_set1 & c_set2 == c_large ) { + setverdict(fail); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_006()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_007.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38724d35dfe9dbaaa7b07d501f42e7a29fd1164b --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_007.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that concatenation mismatch is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_007 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_007() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5,a6:=6}; + + if ( c_set1 & c_set2 != c_large ) { //mismatching in a6 + setverdict(fail); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_007()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_008.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e1718776604eb14570d8ff60fe8be1039ab4ca7 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSem_070103_RelationalOperators_008.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_070103_RelationalOperators_008 { + +type component GeneralComp { +} + + type set IntegerSet1 { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type set IntegerSet2 { + integer a4 optional, + integer a5 optional, + integer a6 optional + }; + + type set LargeSet { + integer a1 optional, + integer a2 optional, + integer a3 optional, + integer a4 optional, + integer a5 optional + }; + + +testcase TC_NegSem_070103_RelationalOperators_008() runs on GeneralComp { + const IntegerSet1 c_set1 := {a1:=0,a2:=omit,a3:=2}; + const IntegerSet2 c_set2 := {a4:=3,a5:=5,a6:=omit}; + const LargeSet c_large := {a1:=0,a2:=omit,a3:=2,a4:=3,a5:=5}; + + if ( c_set1 & c_set2 != c_large ) { //the two expressions are not equal because of mismatching lengths + setverdict(fail); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_070103_RelationalOperators_008()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc4f288a044061bd43681e1ab59e815599e1d05c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater operator on address can not be evaluated. + ** @verdict pass reject, noexecution + *****************************************************************/ + +module NegSyn_070103_RelationalOperators_001 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_NegSyn_070103_RelationalOperators_001() runs on GeneralComp { + + var address My_address :=-1; + + + if (My_address > null) //error, not allowed + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_NegSyn_070103_RelationalOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41df82c179b7bf2df8320d2c238934e216f6c3e8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less operator on address can not be evaluated. + ** @verdict pass reject, noexecution + *****************************************************************/ + +module NegSyn_070103_RelationalOperators_002 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_NegSyn_070103_RelationalOperators_002() runs on GeneralComp { + + var address My_address :=-1; + + //error, not allowed + if (My_address < null) + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_NegSyn_070103_RelationalOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d66a71a70a3181ad4b55d46c32a85a4792f32719 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_003.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less or equal to operator on address can not be evaluated. + ** @verdict pass reject, noexecution + *****************************************************************/ + +module NegSyn_070103_RelationalOperators_003 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_NegSyn_070103_RelationalOperators_003() runs on GeneralComp { + + var address My_address :=-1; + + //error, not allowed + if (My_address <= null) + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_NegSyn_070103_RelationalOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28993462d33d688b6adeb2b452ce06b20a477bcb --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/NegSyn_070103_RelationalOperators_004.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater or equal to operator on address can not be evaluated. + ** @verdict pass reject, noexecution + *****************************************************************/ + +module NegSyn_070103_RelationalOperators_004 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_NegSyn_070103_RelationalOperators_004() runs on GeneralComp { + + var address My_address :=-1; + + //error, not allowed + if (My_address >= null) + { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_NegSyn_070103_RelationalOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ca49e36374a75c28a2802948a2036b617fec184 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_001.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on integers is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_001() runs on GeneralComp { + if (2 == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..508d69b48af6f493dec637e3c0291483f31914b8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_002.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on floats is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_002() runs on GeneralComp { + if (2.0 == 2.0) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c92651c0510d73c9142255bd1bc69773b99f2ca8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_003.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on enumerations is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_003 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_003() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_reference := e_monday; + + if (v_first == v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91f1c628ec377b1bfdee7237f78bdb37ba25f4b1 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_004.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than operator on integers is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_004 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_004() runs on GeneralComp { + if (2 < 3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_005.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd91064018e47935dd36a7db6f969e7e59b7eddd --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_005.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than operator on floats is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_005 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_005() runs on GeneralComp { + if (2.3 < 2.452) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_005()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_006.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54efbe3eaf5d8994fb5d86145898d3215b190989 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_006.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than operator on enumerations is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_006 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_006() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_tuesday; + + if (v_first < v_second) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_006()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_007.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..facb563fe1928d06308af218746ef1d99a2d7adb --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_007.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on integers is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_007 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_007() runs on GeneralComp { + if (2 <= 3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_007()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_008.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f57260456192cf9f71e0962446a803cebbd4a2f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_008.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on integers is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_008 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_008() runs on GeneralComp { + if (2 <= 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_008()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_009.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71854fd3d6e0843a4e6593644df22221c5a9a788 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_009.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on floats is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_009 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_009() runs on GeneralComp { + if (2.3 <= 3.2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_009()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_010.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20eb756b092fbc31e2b78b758225a3cbe175b65f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_010.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on floats is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_010 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_010() runs on GeneralComp { + if (2.3 <= 2.3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_010()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_011.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..275e1f071172a54172cdf4182d80f2341a741732 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_011.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on enumerations is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_011 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_011() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_tuesday; + + if (v_first <= v_second) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_011()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_012.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b46bce0b1ea5248ecec04719c1c075ff1658fffb --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_012.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on enumerations is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_012 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_012() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_monday; + + if (v_first <= v_second) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_012()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_013.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37b22311af80c9b9c5f36048d39119c956acf3f2 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_013.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than operator on integers is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_013 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_013() runs on GeneralComp { + if (3 > 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_013()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_014.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bace9c9c25c75720b370dbe98d256f99f4ff022 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_014.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than operator on floats is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_014 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_014() runs on GeneralComp { + if (2.452 > 2.3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_014()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_015.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..143ecc966169f3a310875139ca6ddf51ddf5f707 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_015.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than operator on enumerations is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_015 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_015() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_tuesday; + + if (v_second > v_first) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_015()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_016.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3a5db35f5271c16eb97a04b7b84d080ff3d8972 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_016.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than or equal to operator on integers is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_016 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_016() runs on GeneralComp { + if (3 >= 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_016()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_017.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9851d6bfd161b635d0c9817215825d16f05086de --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_017.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than or equal to operator on integers is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_017 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_017() runs on GeneralComp { + if (2 >= 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_017()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_018.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5555b942fc25d72e3f1389c4f2e7d0b081d07e44 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_018.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than or equal to operator on floats is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_018 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_018() runs on GeneralComp { + if (3.2 >= 2.3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_018()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_019.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53d02bfeb5a0ce1427137c28ccd3c1c518ff75bb --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_019.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than or equal to operator on floats is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_019 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_019() runs on GeneralComp { + if (2.3 >= 2.3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_019()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_020.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13d3459bee0480ffe53d834c6da2793493e7f984 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_020.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on enumerations is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_020 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_020() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_tuesday; + + if (v_second >= v_first) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_020()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_021.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8f2577f7ee1d15a95b03079107de2cc58edbbc4 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_021.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the greater than or equal to operator on enumerations is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_021 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_021() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_second := e_monday; + + if (v_first >= v_second) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_021()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_022.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54bf4e6c30686101aab92378751834e4bbfe33db --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_022.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not equals operator on integers is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_022 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_022() runs on GeneralComp { + if (2 != 3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_022()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_023.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c16df33054b55f7cf19af48583633d49eb1ee0b7 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_023.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not equals operator on floats is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_023 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_023() runs on GeneralComp { + if (2.12 != 2.3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_023()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_024.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b723e69b88506036d6e273cd204f17aa7d743e5 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_024.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not equals operator on enumerations is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_024 { + +type component GeneralComp { +} + +type enumerated MyEnumType { + e_monday, e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_024() runs on GeneralComp { + var MyEnumType v_first := e_monday; + var MyEnumType v_reference := e_tuesday; + + if (v_first != v_reference) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_024()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_025.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ba05b44ca09e988c372d03fb9b438b9a42f8234 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_025.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on sets is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_025 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_025() runs on GeneralComp { + const IntegerSet c_set := {a1:=0,a2:=omit,a3:=2}; + + if ( { a3:=2, a2:=omit, a1:=0 } == c_set ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_025()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_026.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fd2967c7c8e229c97163fc4e83d485628a1133d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_026.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_026 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_026() runs on GeneralComp { + var IntegerSet v_set := {a1:=0,a2:=omit,a3:=2}; + + if ( v_set == { a1:=0, a2:=omit, a3:=2 } ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_026()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_030.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..29360c4718d54912967cfda6204a99cd7968beb2 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_030.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_030 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_030() runs on GeneralComp { + const IntegerSet c_set := {a1:=1,a2:=omit,a3:=1}; + + if ( c_set.a1 == c_set.a3 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_030()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_031.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6751539a0066823229bd72745cc769f93801f420 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_031.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_031 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_031() runs on GeneralComp { + const IntegerSet c_set := {a1:=omit,a2:=2,a3:=omit}; + + if ( c_set.a1 == c_set.a3 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_031()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_032.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c6894612fff9b73945fb346e9bfb7d321a26b08 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_032.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_032 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_032() runs on GeneralComp { + const IntegerSet c_set := {a1:=omit,a2:=2,a3:=omit}; + + if ( c_set.a2 == 2 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_032()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_033.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e063403de792e3bd2fae7626eca2a09e1e4c972 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_033.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_033 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_033() runs on GeneralComp { + const IntegerSet c_set := {a1:=omit,a2:=2,a3:=omit}; + + if ( c_set.a2 != c_set.a3 ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_033()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_034.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ebc5bbf39e0e41d5d029d9a4369b6e1740d2b74 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_034.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the equals operator on records is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_034 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_070103_RelationalOperators_034() runs on GeneralComp { + const IntegerSet c_set := {a1:=omit,a2:=2,a3:=omit}; + + if ( c_set.a2 == 1 ) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_034()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_035.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62120cd6b10049f11f6a99b4b959959dcce619e0 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_035.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the eqaul to operator on address is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/*The address type is allowed for the equality (==) and non-equality (!=) operators, +independent of its actual type, but when its actual type differs from the types specified above, it can be compared to the literal special value null only. +*/ + +module Sem_070103_RelationalOperators_035 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_Sem_070103_RelationalOperators_035() runs on GeneralComp { + + var address My_address:=null; + + + if (My_address == null) { + setverdict(pass,My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_035()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_036.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c791b77e19b4a885856c5e8ada13bad677844b9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_036.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the eqaul to operator on address is evaluated correctly with equal values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/*The address type is allowed for the equality (==) and non-equality (!=) operators, independent of its actual type, but when its actual type differs from the types specified above, it can be compared to the literal special value null only.*/ + +module Sem_070103_RelationalOperators_036 { + +type component GeneralComp { +} + +type integer address; + +testcase TC_Sem_070103_RelationalOperators_036() runs on GeneralComp { + + var address My_address:=2; + + + if (My_address == 2) { + setverdict(pass,My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_036()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_037.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..042cb068692a2cfedf8ef7e42a043610dac8bc89 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_037.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the not eqaul to operator on record type address is evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/*The address type is allowed for the equality (==) and non-equality (!=) operators, independent of its actual type, but when its actual type differs from the types specified above, it can be compared to the literal special value null only.*/ + +module Sem_070103_RelationalOperators_037 { + +type component GeneralComp { +} + +type record Myaddress_type { + integer field1, + float field2 +} + +type Myaddress_type address; + +testcase TC_Sem_070103_RelationalOperators_037() runs on GeneralComp { + + var address My_address:=null; + + + if (My_address == null) { + setverdict(pass, My_address); + } else { + setverdict(fail,My_address); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_037()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_038.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c0621f44e44bc7abdf8c254f92a100f89b3800c --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_038.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that less than operator evaulates correctly infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_038 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_038() runs on GeneralComp { + + var float My_val:= 100.0; + + + if (My_val < infinity) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_038()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_039.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3db450ec74d5438a11a0f02d2f3b384e465b7663 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_039.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that less than or equal to operator evaulates correctly infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_039 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_039() runs on GeneralComp { + + var float My_val:= 100.0; + + + if (My_val <= infinity) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_039()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_040.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99052ec8138a662fcc1cae8810f7b9bc11d42191 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_040.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that greather than operator evaulates correctly -infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_040 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_040() runs on GeneralComp { + + var float My_val:= 1.0; + + + if (-infinity < My_val) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_040()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_041.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4760b95dff05d26d7413a5cd08fa2f9dd64e4b16 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_041.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that greather than or equal to operator evaulates correctly -infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_041 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_041() runs on GeneralComp { + + var float My_val:= 1.0; + + + if (-infinity <= My_val) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_041()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_042.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d84288b3ccf1365d594f45236cdc71b27fe26230 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_042.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that equal to operator evaulates correctly -infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_042 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_042() runs on GeneralComp { + + var float My_val := -1.0 * infinity; // My_val= -infinity + + if (-infinity == My_val) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_042()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_043.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f14299d5a55b8a4513f712450fb81ca01cfe6b8 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_043.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that equal to operator evaulates correctly infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_043 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_043() runs on GeneralComp { + + var float My_val := -1.0 * -infinity; // My_val= infinity + + if (infinity == My_val) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_043()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_044.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ba47f5906591f3c5c2d12825d0ac29f30f77c14 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_044.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that not equal to operator evaulates correctly infinity special float + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_044 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_044() runs on GeneralComp { + + var float My_val := 1.0 * -infinity; // My_val= -infinity + + if (infinity != My_val) { + setverdict(pass, My_val); + } else { + setverdict(fail, My_val); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_044()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_045.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d57127b0dec5e8012c55fd42e229a14cdce7dcbe --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_045.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that NaN special float is evaulated correctly in a relation. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_045 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_045() runs on GeneralComp { + + var float My_val := 1.0; + + if (My_val < not_a_number) { + setverdict(pass, My_val); + } else { + setverdict(fail, My_val); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_045()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_046.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5dd8836c54c202f38f53b916ceb4cbee63fa357b --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_046.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that NaN special float is evaulated correctly in a relation. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_046 { + +type component GeneralComp { +} + + + +testcase TC_Sem_070103_RelationalOperators_046() runs on GeneralComp { + + + if (infinity < not_a_number) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_046()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_047.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24bc1fa0df0ee478d7f55ebff5d1bc3c4de73c21 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_047.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that infinity special float is evaulated correctly in a relation. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070103_RelationalOperators_047 { + +type component GeneralComp { +} + +testcase TC_Sem_070103_RelationalOperators_047() runs on GeneralComp { + + + if (-infinity < infinity) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_047()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_048.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdaa717cfddfe68c820eb2375055999829412e3a --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_048.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that anytypes can be compared + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Values of the same or any two anytype types can be compared. +// For anytype values the same rule apply as to union values, with the addition that names of user-defined types defined with the same name in different modules do not denote the same type name of the selected alternatives. + +module Sem_070103_RelationalOperators_048 { + +type component GeneralComp { +} + +type anytype Atype_1; + +type anytype Atype_2; + +testcase TC_Sem_070103_RelationalOperators_048() runs on GeneralComp { + + var Atype_1 v_any1; + var Atype_2 v_any2; + + v_any1.integer := 2; + v_any2.integer := 4; + + if (v_any1.integer < v_any2.integer) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_048()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_049.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..530ae6ebbe6ff5505c0e037dae49c742056cd451 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_049.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that anytypes can be compared + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Values of the same or any two anytype types can be compared. +// For anytype values the same rule apply as to union values, with the addition that names of user-defined types defined with the same name in different modules do not denote the same type name of the selected alternatives. + + +module Sem_070103_RelationalOperators_049 { + +type component GeneralComp { +} + +type anytype Atype; + +testcase TC_Sem_070103_RelationalOperators_049() runs on GeneralComp { + + var Atype v_any1; + var Atype v_any2; + + v_any1.float := 2.4; + v_any2.float := 4.2; + + if (v_any1.float < v_any2.float) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_049()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_050.ttcn b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a1d9cb8a3a36323e66716c3b0cbfd6487f992dd --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070103_relational_operators/Sem_070103_RelationalOperators_050.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7.1.3, Ensure that the less than or equal to operator on enumerations is evaluated correctly with differing values. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +/* Two enumerated values are equal if and only if they are associated + * with the same integer value. Otherwise, they are ordered using the + * mathematical order on the associated integer values.*/ + + +module Sem_070103_RelationalOperators_050 { + +type component GeneralComp { +} + +type enumerated MyEnumType1 { + e_monday(2), e_tuesday, e_wednesday, e_thursday, e_friday +}; + +type enumerated MyEnumType2 { + e_monday(1..8), e_tuesday, e_wednesday, e_thursday, e_friday +}; + +testcase TC_Sem_070103_RelationalOperators_050() runs on GeneralComp { + var MyEnumType1 v_first := e_monday; + var MyEnumType2 v_second := e_monday(2); + + if (match(enum2int(v_first),enum2int(v_second))) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070103_RelationalOperators_050()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..93279cec148b7e1f7167f822e85225127750e8e9 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.4, Ensure that the boolean operator supports negation. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070104_LogicalOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070104_LogicalOperators_001() runs on GeneralComp { + var boolean v_test := true; + v_test := not v_test; + + if (v_test == false) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070104_LogicalOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d1a5f06499651ce2c136956beaf7543b54128c0 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070104_logical_operators/Sem_070104_LogicalOperators_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.4, Ensure that the the and operator with true and false as operands work on boolean variables. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070104_LogicalOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070104_LogicalOperators_002() runs on GeneralComp { + var boolean v_first := true; + var boolean v_second := false; + + var boolean v_result := v_first and v_second; + + if (v_result == false) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070104_LogicalOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87e532f60b39bed579a90075de9b7f3e422e9a17 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.5, Ensure that the bitwise negation operator works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070105_BitwiseOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070105_BitwiseOperators_001() runs on GeneralComp { + var bitstring v_test := '1'B; + var bitstring v_result := not4b v_test; + + if (v_result == '0'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070105_BitwiseOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f82b480783579659cb4e1e1409ed9a075bbeb11 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070105_bitwise_operators/Sem_070105_BitwiseOperators_002.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.5, Ensure that the bitwise negation operator works as expected on hexstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070105_BitwiseOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070105_BitwiseOperators_002() runs on GeneralComp { + var hexstring v_test := '1A5'H; + var hexstring v_result := not4b v_test; + + if (v_result == 'E5A'H) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070105_BitwiseOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3db32f154b02ff63b406fdf23060a5549325295 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.6, Ensure that the shift left operator works as expected on bitstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070106_ShiftOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070106_ShiftOperators_001() runs on GeneralComp { + var bitstring v_test := '111001'B; + var bitstring v_result := v_test << 2; + + if (v_result == '100100'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070106_ShiftOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b557cef0afd55b881cd3569735632f4f40e2702d --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_002.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.6, Ensure that the shift left operator works as expected on hexstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070106_ShiftOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070106_ShiftOperators_002() runs on GeneralComp { + var hexstring v_test := '12345'H; + var hexstring v_result := v_test << 2; + + if (v_result == '34500'H) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070106_ShiftOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfb21f445ae5d8676a6e52b7443b432d02cf280b --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_003.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.6, Ensure that the shift right operator works as expected on bitstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070106_ShiftOperators_003 { + +type component GeneralComp { +} + +testcase TC_Sem_070106_ShiftOperators_003() runs on GeneralComp { + var bitstring v_test := '111001'B; + var bitstring v_result := v_test >> 2; + + if (v_result == '001110'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070106_ShiftOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef855568a517bb43981dbb135a0b60d190e1e3c5 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070106_shift_operators/Sem_070106_ShiftOperators_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.6, Ensure that the shift right operator works as expected on hexstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070106_ShiftOperators_004 { + +type component GeneralComp { +} + +testcase TC_Sem_070106_ShiftOperators_004() runs on GeneralComp { + var hexstring v_test := '12345'H; + var hexstring v_result := v_test >> 2; + + if (v_result == '00123'H) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070106_ShiftOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_001.ttcn b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92e95952e51c23ee21bb255d5cc89e23295c8916 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.7, Ensure that the rotate left operator works as expected on bitstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070107_RotateOperators_001 { + +type component GeneralComp { +} + +testcase TC_Sem_070107_RotateOperators_001() runs on GeneralComp { + var bitstring v_test := '101001'B; + var bitstring v_result := v_test <@ 2; + + if (v_result == '100110'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070107_RotateOperators_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_002.ttcn b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdba31bd9a0cbb0e7466e217aba59dd95fffd73f --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_002.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.7, Ensure that the rotate left operator works as expected on hexstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070107_RotateOperators_002 { + +type component GeneralComp { +} + +testcase TC_Sem_070107_RotateOperators_002() runs on GeneralComp { + var hexstring v_test := '12345'H; + var hexstring v_result := v_test <@ 2; + + if (v_result == '34512'H) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070107_RotateOperators_002()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_003.ttcn b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ef11e9d22db340a662f764ed7cfea27d6e4f248 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_003.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.7, Ensure that the rotate right operator works as expected on bitstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070107_RotateOperators_003 { + +type component GeneralComp { +} + +testcase TC_Sem_070107_RotateOperators_003() runs on GeneralComp { + var bitstring v_test := '100001'B; + var bitstring v_result := v_test @> 2; + + if (v_result == '011000'B) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070107_RotateOperators_003()); +} + +} diff --git a/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_004.ttcn b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..afd5a73e2272b43bd398c616c4eca879ae31a1b5 --- /dev/null +++ b/ATS/core_language/07_expressions/0701_operators/070107_rotate_operators/Sem_070107_RotateOperators_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.1.7, Ensure that the rotate right operator works as expected on hexstrings. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_070107_RotateOperators_004 { + +type component GeneralComp { +} + +testcase TC_Sem_070107_RotateOperators_004() runs on GeneralComp { + var hexstring v_test := '12345'H; + var hexstring v_result := v_test @> 2; + + if (v_result == '45123'H) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_070107_RotateOperators_004()); +} + +} diff --git a/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_001.ttcn b/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2790d5d36d08bdde24459da321d741ab675b4a2 --- /dev/null +++ b/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field referencing + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_0702_FieldReferencesAndListElements_001 { + +type component GeneralComp { +} + +type record MyRecord1 { + integer field1, + charstring field2 +} + +testcase TC_Sem_0702_FieldReferencesAndListElements_001() runs on GeneralComp { + var MyRecord1 v_test := {1, "Hello World!"}; + + if ( match(v_test, {1, "Hello World!"})) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0702_FieldReferencesAndListElements_001()); +} + +} diff --git a/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_002.ttcn b/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed4c7b2d986a61d09d664abe3f1712b257da09aa --- /dev/null +++ b/ATS/core_language/07_expressions/0702_field_references_and_list_elements/Sem_0702_FieldReferencesAndListElements_002.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:7.2, Ensure that the IUT correctly handles field referencing + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_0702_FieldReferencesAndListElements_002 { + +type component GeneralComp { +} + +type record of integer IntegerArray; + +testcase TC_Sem_0702_FieldReferencesAndListElements_002() runs on GeneralComp { + var IntegerArray v_test := {20, 41, 12}; + + if ( match(v_test, {20, 41, 12}) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0702_FieldReferencesAndListElements_002()); +} + +} diff --git a/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_001.ttcn b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec872c3ab0d074c605020ee75b7c0ca663517b0a --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, function without return clause in expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Functions used in expressions shall have a return clause. + +module NegSem_07_toplevel_001 +{ + type component GeneralComp { + } + + function f() + { + var integer v_num := 1; + } + + testcase TC_NegSem_07_toplevel_001() runs on GeneralComp { + var integer v_num := 3 * f(); + setverdict(pass); + } + + control { + execute(TC_NegSem_07_toplevel_001()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_002.ttcn b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15fdb4a7831b701e1f926069914285f0d3452f63 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, template used as expression operand + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The operands of the operators used in an expression shall be values and their root +// types shall be the types specified for the appropriate operator in the subsequent +// clauses. + +module NegSem_07_toplevel_002 +{ + type component GeneralComp { + } + + function f() + { + var integer p_num := 1; + } + + testcase TC_NegSem_07_toplevel_002() runs on GeneralComp { + var template(value) integer vm_num := 3; + var integer p_num := 3 * vm_num; + setverdict(pass); + } + + control { + execute(TC_NegSem_07_toplevel_002()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_003.ttcn b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69d5ff2f9010933342cbb9bc72c3aa1a77eff547 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, uninitialized value in an expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// At the point, when an expression is evaluated, the evaluated values of the +// operands used in expressions shall be completely initialized except where +// explicitly stated otherwise in the specific clause of the operator. + +module NegSem_07_toplevel_003 +{ + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + testcase TC_NegSem_07_toplevel_003() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + if (10 + v_rec.field2 != -1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_07_toplevel_003()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_004.ttcn b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20b660ecbf5bb2761dd18247d73143d84f533ce2 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, partially initialized value in an expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// At the point, when an expression is evaluated, the evaluated values of the +// operands used in expressions shall be completely initialized except where +// explicitly stated otherwise in the specific clause of the operator. + +module NegSem_07_toplevel_004 +{ + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + testcase TC_NegSem_07_toplevel_004() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + if (not match(v_rec, { 20, 6 })) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_07_toplevel_004()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_005.ttcn b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8d7181dad3e1f16d475013dfc45665a767fa1c0 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/NegSem_07_toplevel_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, null value in an expression + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// With the exception of the equality and non-equality operators, the special +// value null shall not be used as an operand of expressions (see clause 7.1.3). + +module NegSem_07_toplevel_005 +{ + type component GeneralComp { + } + + type integer address; + + testcase TC_NegSem_07_toplevel_005() runs on GeneralComp { + var address v_addr := null; + if (10 + v_addr != -1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_07_toplevel_005()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_001.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca2bff1b4f1ac7d073dc0f1446153ca3900423f8 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, expression composed of several expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Expressions may be built from other (simple) expressions. + +module Sem_07_toplevel_001 +{ + type component GeneralComp { + } + + function f() return integer + { + return 5; + } + + testcase TC_Sem_07_toplevel_001() runs on GeneralComp { + var integer v_num := 3; + var integer v_res := -v_num + f() * 2 - 3; + if (v_res == 4) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_001()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_002.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c47f080020ba7edcf43bfcb2084d7d3908df334 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of array type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Compound expressions are used for expressions of array, record, record of and +// set of types. + +module Sem_07_toplevel_002 +{ + type component GeneralComp { + } + + testcase TC_Sem_07_toplevel_002() runs on GeneralComp { + var integer v_arr[2]; + v_arr[0] := 1; + v_arr[1] := 2; + if (v_arr == { 1, 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_002()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_003.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70eca31867273ed46057ed996f54dc19fd4c2978 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of record type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Compound expressions are used for expressions of array, record, record of and +// set of types. + +module Sem_07_toplevel_003 +{ + type component GeneralComp { + } + + type record R { + integer field1, + charstring field2 optional + } + + testcase TC_Sem_07_toplevel_003() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + v_rec.field2 := omit; + if (v_rec == { field1 := 1, field2 := omit }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_003()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_004.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d348c7b5c87bd45b0bd2efee9d5ae0eefb14069 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_004.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of record-of type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Compound expressions are used for expressions of array, record, record of and +// set of types. + +module Sem_07_toplevel_004 +{ + type component GeneralComp { + } + + type record of integer RI; + + testcase TC_Sem_07_toplevel_004() runs on GeneralComp { + var RI v_rec; + v_rec[0] := 1; + v_rec[1] := 2; + if (v_rec == { 1, 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_004()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_005.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7d5adb7bb3e8fa5c95ed2dbf0c811afe341213f --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_005.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of set-of type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Compound expressions are used for expressions of array, record, record of and +// set of types. + +module Sem_07_toplevel_005 +{ + type component GeneralComp { + } + + type set of integer SI; + + testcase TC_Sem_07_toplevel_005() runs on GeneralComp { + var SI v_set; + v_set[0] := 1; + v_set[1] := 2; + if (v_set == { [0] := 1, [1] := 2 }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_005()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_006.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1843b1f5025d8d636684d45364824e3066a3000 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_006.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:7, element of partially initialized structured value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// This means also that all fields and elements of structured types referenced +// in an expression shall contain completely initialized values, while other +// fields and elements, not used in the expression, may be uninitialized or +// contain omit. + +module Sem_07_toplevel_006 +{ + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 optional + } + + testcase TC_Sem_07_toplevel_006() runs on GeneralComp { + var R v_rec; + v_rec.field1 := 1; + if (10 + v_rec.field1 == 11) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_006()); + } +} diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_007.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15657870c6d43f4e1fb9df1c0cb3da6cfb322b71 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_007.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of set-of type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Assignment or list notations are used for expressions of record, set, record of, set of, array, union and anytype types. + +module Sem_07_toplevel_007 +{ + type component GeneralComp { + } + + type anytype Atype; + + type record R { + integer field1, + charstring field2 optional + } + + testcase TC_Sem_07_toplevel_007() runs on GeneralComp { + var Atype v_any; + v_any.R.field1 := 1; + v_any.R.field2 := omit; + if (v_any.R == { field1 := 1, field2 := omit }) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_008.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bfcebc7d857f205a03bcdcc2a099d562dff7f296 --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_008.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of set-of type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Assignment or list notations are used for expressions of record, set, record of, set of, array, union and anytype types. + +module Sem_07_toplevel_008 +{ + type component GeneralComp { + } + + type union U { + integer field1, + charstring field2 + } + + testcase TC_Sem_07_toplevel_008() runs on GeneralComp { + var U v_union := { field2 := "abc" }; + + if (v_union == {field2 := "abc" }) { setverdict(pass); } + else { setverdict(fail,v_union); } + } + + control { + execute(TC_Sem_07_toplevel_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_009.ttcn b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91ea30fbd274bf3f04e5e1fb9e7ea2b61515b7bc --- /dev/null +++ b/ATS/core_language/07_expressions/07_toplevel/Sem_07_toplevel_009.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:7, compound expression as an operand of set type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Compound expressions are used for expressions of array, record, record of and +// set of types. + +module Sem_07_toplevel_009 +{ + type component GeneralComp { + } + + type set SI + { + integer field1, + integer field2 + }; + + testcase TC_Sem_07_toplevel_009() runs on GeneralComp { + var SI v_set; + v_set.field1 := 1; + v_set.field2 := 2; + if (match(v_set,{ field1 := 1, field2 := 2 })) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_07_toplevel_009()); + } +} diff --git a/ATS/core_language/07_expressions/NOTES b/ATS/core_language/07_expressions/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..d4f1fe19bff0314d40950b03fd336ae1f039c7a3 --- /dev/null +++ b/ATS/core_language/07_expressions/NOTES @@ -0,0 +1,2 @@ +- TODO: add some operator precedence tests... +- TODO: add more tests in general \ No newline at end of file diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/NegSyn_0801_DefinitionOfAModule_001.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/NegSyn_0801_DefinitionOfAModule_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3df0af6a101a16c45c6bf9eaf803c130274c1740 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/NegSyn_0801_DefinitionOfAModule_001.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with multiple language specifications is rejected. + ** @verdict pass reject + *****************************************************************/ +// list of languages is not allowed +module NegSyn_0801_DefinitionOfAModule_001 language "TTCN-3:2005", "TTCN-3:2009", "TTCN-3:2010" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_001.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a77b0476ca547a31cd9bf06c96aecf810110f99e --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_001.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a "plain" module definition is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_001 { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_002.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc097462a97447d032bbe7f97920548238169009 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_002.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with language specification is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_002 language "TTCN-3:2005" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_003.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd2039768bf601f57bdb762bf704df76ca631ee2 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_003.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_003 language "TTCN-3:2010", "TTCN-3:2010 Advanced Parameterization" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_004.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d0bc2c1e2b57ff602196aac2d37a78e363059f8 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_004.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with package and without language is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_004 language "TTCN-3:2010 Advanced Parameterization" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_005.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed60d3a08a466032eb5e1f06fbd66924edaa82b1 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_005.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.3.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_005 language "TTCN-3:2011", "TTCN-3:2010 Advanced Parameterization" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_006.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..507e644b0e8c36c744fa5e610567d2355af02a29 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_006.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.4.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_006 language "TTCN-3:2012" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_007.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..543d40eb70214a537fafb0dab751aafbfa79a262 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_007.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.5.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_007 language "TTCN-3:2013" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_008.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70d20b435a94a95b7c93e5c809d6791150b9fbb9 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_008.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.6.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_008 language "TTCN-3:2014" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_009.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b19520be8f7628a27a00cac31e0051f0da800015 --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_009.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.7.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_009 language "TTCN-3:2015" { + +} diff --git a/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_010.ttcn b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23a8db2d7818476f16e10f4ea00953ef819b8d0a --- /dev/null +++ b/ATS/core_language/08_modules/0801_definition_of_a_module/Syn_0801_DefinitionOfAModule_010.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.1, Ensure that a module definition with ed4.8.1 language and package is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0801_DefinitionOfAModule_010 language "TTCN-3:2016" { + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34c8f6100cbb302490d7e59572590991a19ba5d3 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a port, default or component types cannot be module parameters. + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +/* Restriction B: Module parameters shall not be of port type, + * default type or component type and shall not be of a structured type that contains a sub-element of + * port type at any level of nesting.*/ + +module NegSem_080201_ModuleParameters_001 { + + type port MyMessagePortType message + { + in integer; + out integer; + inout integer + } + +modulepar MyMessagePortType MY_PORT; // not allowed + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_001() runs on GeneralComp { + if (MY_PORT) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_001()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5020c75a25d06b5ef07e3d04a71a75f0faa2a243 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_002.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a port, default or component types cannot be module parameters. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +/* Restriction B: Module parameters shall not be of port type, + * default type or component type and shall not be of a structured type that contains a sub-element of + * port type at any level of nesting.*/ + +module NegSem_080201_ModuleParameters_002 { + + type port MyMessagePortType message + { + in integer; + out integer; + inout integer + } + + type component My_component_type{ + port MyMessagePortType pCO1; + + } + + +modulepar My_component_type MY_COMP; // not allowed + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_002() runs on GeneralComp { + + if (MY_COMP.running) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_002()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a1628d71f62019193566c74436f2e18cb18b87d --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_003.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a port, default or component types cannot be module parameters. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +/* Restriction B: Module parameters shall not be of port type, + * default type or component type and shall not be of a structured type that contains a sub-element of + * port type at any level of nesting.*/ + +module NegSem_080201_ModuleParameters_003 { + + +modulepar default MY_DEF := null; // not allowed + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_003() runs on GeneralComp { + + if (MY_DEF == null) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_003()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8576132ce2f71be715703258c00b84f52b552a5 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_004.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that module parameters remain constant. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +/* Restriction B: Module parameters shall not be of port type, + * default type or component type and shall not be of a structured type that contains a sub-element of + * port type at any level of nesting.*/ + +module NegSem_080201_ModuleParameters_004 { + + +modulepar integer MY_INT := 2; + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_004() runs on GeneralComp { + MY_INT := 3; // not allowed to change module parameter + if (MY_INT == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_004()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_005.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27d7b2658b242e22c48c6992b6b0c8145e44f4b0 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_005.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a reference to plain module parameter with a default value delivers the default value unless it is overwritten. + ** @verdict pass reject + *****************************************************************/ +// A module parameter shall only be of type address if the address type is explicitly defined within the associated module + +module NegSem_080201_ModuleParameters_005 { + +modulepar address MY_ADDRESS_MODULE_PARAMETER := 2; // error: address type not defined + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_005() runs on GeneralComp { + if (MY_ADDRESS_MODULE_PARAMETER == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_005()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_006.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e64dca802576f362bb9dd40a4db2366440201bb9 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSem_080201_ModuleParameters_006.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a reference to plain module parameter with a default value delivers the default value unless it is overwritten. + ** @verdict pass reject + *****************************************************************/ +//Module parameters shall not be used in type or array definitions. + +module NegSem_080201_ModuleParameters_006 { + +modulepar integer MY_INT_MODULE_PARAMETER := 2; + +type component GeneralComp { +} + +testcase TC_NegSem_080201_ModuleParameters_006() runs on GeneralComp { + + var integer my_int_array[1] := MY_INT_MODULE_PARAMETER; // error: Module parameters shall not be used in type or array definitions. + if (my_int_array[2] == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_080201_ModuleParameters_006()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9cdcac62d37ea5b61498b1bc036f623f404d3025 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_001.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that module parameter can be declared within the module definition part only. + ** @verdict pass reject, noexecution + *****************************************************************/ +module NegSyn_080201_ModuleParameters_001 { + + +type component GeneralComp { +} + +testcase TC_NegSyn_080201_ModuleParameters_001() runs on GeneralComp { + +modulepar integer MY_MODULE_PAR := 1; // not allowed to declared here + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9ad4ee0d9262b27a41a9e8ed6449075bb290fde --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/NegSyn_080201_ModuleParameters_002.ttcn @@ -0,0 +1,11 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that module parameter can be declared within the module definition part only. + ** @verdict pass reject, noexecution + *****************************************************************/ +module NegSyn_080201_ModuleParameters_002 { +modulepar integer MY_MODULE_PAR := 1; +modulepar integer MY_MODULE_PAR := 2; //error: not allowed to redeclare + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9aac35f47937eade6676d690564793cc068b569 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a reference to plain module parameter with a default value delivers the default value unless it is overwritten. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080201_ModuleParameters_001 { + +modulepar integer MY_INTEGER_MODULE_PARAMETER := 2; + +type component GeneralComp { +} + +testcase TC_Sem_080201_ModuleParameters_001() runs on GeneralComp { + if (MY_INTEGER_MODULE_PARAMETER == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080201_ModuleParameters_001()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e96f47c896d8f40c271e57492ec41685c32f23a --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_002.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a reference to plain module parameter with a default value delivers the default value unless it is overwritten. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// A module parameter shall only be of type address if the address type is explicitly defined within the associated module +module Sem_080201_ModuleParameters_002 { + +type integer address; + +modulepar address MY_ADDRESS_MODULE_PARAMETER := 2; + +type component GeneralComp { +} + +testcase TC_Sem_080201_ModuleParameters_002() runs on GeneralComp { + if (MY_ADDRESS_MODULE_PARAMETER == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080201_ModuleParameters_002()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5dda8c79b1f18c52ef20f7f583500475da532cd --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_ModuleParameters_003.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that a reference to plain module parameter with a default value delivers the default value unless it is overwritten. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//More than one occurrence of module parameters declaration is allowed but each parameter shall be declared only once (i.e. redefinition of the module parameter is not allowed). + +module Sem_080201_ModuleParameters_003 { + +modulepar integer MY_INTEGER_MODULE_PARAMETER := 2; +modulepar float MY_FLOAT_MODULE_PARAMETER := 1.23; + +type component GeneralComp { +} + +testcase TC_Sem_080201_ModuleParameters_003() runs on GeneralComp { + if (MY_INTEGER_MODULE_PARAMETER == 2 and MY_FLOAT_MODULE_PARAMETER == 1.23) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080201_ModuleParameters_003()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43811f1f9625815049c0f19785c0918f300fa016 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_001.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that plain module parameters are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_080201_ModuleParameters_001 { + modulepar integer MY_INTEGER_MODULE_PARAMETER; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a02dfff38931ffdadb601c9d8f5c3f21652898a8 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_002.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that plain module parameters with default values are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_080201_ModuleParameters_002 { + modulepar integer MY_INTEGER_MODULE_PARAMETER := 2; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b442a2ecb0974ad1159bc5e849cbbb82f477b5de --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Syn_080201_ModuleParameters_003.ttcn @@ -0,0 +1,10 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.1, Ensure that plain module parameters with default values and visibility modifiers are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_080201_ModuleParameters_003 { + private modulepar integer MY_INTEGER_MODULE_PARAMETER := 2; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e57065156d8257ce4057140c5a697ff0fda690c4 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_001.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.2, Ensure that a definition within a group is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_080202_GroupOfDefinitions_001 { + group TYPEDEF_GROUP { + group RECORDS_GROUP { + public type record MyRecord1 { + integer field1, + charstring field2 + } + } + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f3f1adc3374952228539c5dbc59d498c4d6171f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_002.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.2, Ensure that a definition within a nested group is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_080202_GroupOfDefinitions_002 { + group MY_TYPEDEF_GROUP { + + public type record MyRecord1 { + integer field1, + charstring field2 + } + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e1fdc86badd304961b7c295b6a6c93418dc2beb --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_003.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.2, Ensure that a definition within a group with public visibility modifier is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_080202_GroupOfDefinitions_003 { + public group TYPEDEF_GROUP { + public type record MyRecord1 { + integer field1, + charstring field2 + } + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81023c0b42d9b3fef3c2bf7595c51c2dc33cc2c1 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080202_groups_of_definitions/Syn_080202_GroupOfDefinitions_004.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.2, Ensure that a definition within a group with public visibility modifier and attributes is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_080202_GroupOfDefinitions_004 { + public group TYPEDEF_GROUP { + public type record MyRecord1 { + integer field1, + charstring field2 + } + } with { + encode "Encoding 3"; + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff684a363d8fa694b803afe96d263c7d1e713415 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_001.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that name handling of imported enumerations is properly handled + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_08020301_GeneralFormatOfImport_001 { + import from NegSem_08020301_GeneralFormatOfImport_001_import all; + + + //according to CR5607 the following definitions are not allowed, name conflict must be detected + const EnumType2 enumX := enumX; + const EnumType enumY := enumX; + +} + +module NegSem_08020301_GeneralFormatOfImport_001_import { + type enumerated EnumType {enumX, enumY, enumZ}; + type enumerated EnumType2 {enumX, enumY, enumZ}; + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31f3c27086e5d39ba9df33d21e6476bdedf2a103 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_002.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:8.2.3.1, Ensure that name handling of imported enumerations is properly handled + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_08020301_GeneralFormatOfImport_002 language "TTCN-3:2016"{ + import from NegSem_08020301_GeneralFormatOfImport_002_import all; + + const EnumType2 c_enum := enumX; + + modulepar EnumType px_ModulePar := NegSem_08020301_GeneralFormatOfImport_002.c_enum; //type mismatch +} + +module NegSem_08020301_GeneralFormatOfImport_002_import { + type enumerated EnumType {enumX, enumY, enumZ}; + type enumerated EnumType2 {enumX, enumY, enumZ}; + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..882e926cfed76fae489272213e582f3314aa06b1 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_003.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that transitive import rules are properly handled + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_08020301_GeneralFormatOfImport_003 { + +import from NegSem_08020301_GeneralFormatOfImport_003_import { + const all; +}; + +type component GeneralComp {} + +testcase TC_NegSem_08020301_GeneralFormatOfImport_003() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_08020301_GeneralFormatOfImport_003()); +} +} + +module NegSem_08020301_GeneralFormatOfImport_003_import { + public import from NegSem_08020301_GeneralFormatOfImport_003_import_2 all; +} + + +module NegSem_08020301_GeneralFormatOfImport_003_import_2 { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59c9c8c28ea7332d63eb3b578a174c6e846bdabc --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_004.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that transitive import rules are properly handled + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_08020301_GeneralFormatOfImport_004 { + +import from NegSem_08020301_GeneralFormatOfImport_004_import all; + +type component GeneralComp {} + +testcase TC_NegSem_08020301_GeneralFormatOfImport_004() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_08020301_GeneralFormatOfImport_004()); +} +} + +module NegSem_08020301_GeneralFormatOfImport_004_import { + import from NegSem_08020301_GeneralFormatOfImport_004_import_2 all; +} + + +module NegSem_08020301_GeneralFormatOfImport_004_import_2 { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_005.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..906b72604968d60cee813b3ee7aa174a5e40d313 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_005.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that the identifier of the current module cannot be used for prefixing imported entities + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Name clashes shall be resolved using qualified name(s) for the imported definition(s), +// i.e. prefixing the imported definition by the identifier of the module in which it has +// been defined; the prefix and the identifier shall be separated by a dot ("."). +// In cases where there are no ambiguities the prefixing need not (but may) be present +// when the imported definitions are used. + +module NegSem_08020301_GeneralFormatOfImport_005 { + +import from NegSem_08020301_GeneralFormatOfImport_005_import all; + +type component GeneralComp {} + +testcase TC_NegSem_08020301_GeneralFormatOfImport_005() runs on GeneralComp { + log(NegSem_08020301_GeneralFormatOfImport_005.c_test); + setverdict(pass); +} + +control{ + execute(TC_NegSem_08020301_GeneralFormatOfImport_005()); +} +} + +module NegSem_08020301_GeneralFormatOfImport_005_import { + const integer c_test := 5; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_006.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82b357ac5a31c5e74d5566da14b6ff64b4153eae --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_006.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that the only top-level visible definitions of a module may be imported. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction b: +// Only top-level visible definitions of a module may be imported. Definitions which +// are top-level but invisible to the importing module or which occur at a lower scope +// (e.g. local constants defined in a function) shall not be imported. + +module NegSem_08020301_GeneralFormatOfImport_006 { +import from NegSem_08020301_GeneralFormatOfImport_006_import { const c_test }; + +type component GeneralComp {} + +testcase TC_NegSem_08020301_GeneralFormatOfImport_006() runs on GeneralComp { + log(c_test); + setverdict(pass); +} + +control{ + execute(TC_NegSem_08020301_GeneralFormatOfImport_006()); +} +} + +module NegSem_08020301_GeneralFormatOfImport_006_import { + control { + const integer c_test := 5; + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_007.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed0752361278e10bc9323309874a0f1529c8671d --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_007.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that information about message types is imported together with port type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// User defined type, port type + +module NegSem_08020301_GeneralFormatOfImport_007 { +import from NegSem_08020301_GeneralFormatOfImport_007_import { type P }; + +type component GeneralComp { + port P p1; +} + +testcase TC_NegSem_08020301_GeneralFormatOfImport_007() runs on GeneralComp { + // Since the type of the sent message is not compatible with the allowed types of the imported + // port type, a type compatibility error shall be generated. This proves that the type information + // has been properly imported. + p1.send(charstring:"abc"); + setverdict(pass); +} + +control{ + execute(TC_NegSem_08020301_GeneralFormatOfImport_007()); +} +} + +module NegSem_08020301_GeneralFormatOfImport_007_import { + type port P message { + inout integer; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_008.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d18815f7f213623d8a70cd792cb7b3c8fec2ae45 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_008.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of module parameter types are not imported together with module parameters + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a module parameter: module parameter type + +module NegSem_08020301_GeneralFormatOfImport_008 { +import from NegSem_08020301_GeneralFormatOfImport_008_import { modulepar PX_TEST }; + const MyType c_test := 1; // MyType should be undefined, because it is not automatically imported +} + +module NegSem_08020301_GeneralFormatOfImport_008_import { + type integer MyType; + modulepar MyType PX_TEST; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_009.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50ae21533d5d531a6de6e1310fd668cd1b82acd3 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_009.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of constant types are not imported together with constants + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a constant: constant type + +module NegSem_08020301_GeneralFormatOfImport_009 { +import from NegSem_08020301_GeneralFormatOfImport_009_import { const c_test }; + const MyType c_test := 1; // MyType should be undefined, because it is not automatically imported +} + +module NegSem_08020301_GeneralFormatOfImport_009_import { + type integer MyType; + const MyType c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_010.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4207940a224262c3a373e3221acae652ac6982e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_010.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of field types are not imported together with structured types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a structured type: field types + +module NegSem_08020301_GeneralFormatOfImport_010 { +import from NegSem_08020301_GeneralFormatOfImport_010_import { type R }; + const MyType c_test := 1; // MyType should be undefined, because it is not automatically imported +} + +module NegSem_08020301_GeneralFormatOfImport_010_import { + type integer MyType; + type record R { + MyType field1 + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_011.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9694d94eb96e5ff218db062c999b27cd6f3410d2 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_011.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of message types are not imported together with port types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a port type: message types + +module NegSem_08020301_GeneralFormatOfImport_011 { +import from NegSem_08020301_GeneralFormatOfImport_011_import { type P }; + const MyType c_test := 1; // MyType should be undefined, because it is not automatically imported +} + +module NegSem_08020301_GeneralFormatOfImport_011_import { + type integer MyType; + type port P message { + inout MyType + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_012.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f426d94ccd771acfb5b968c47f1dc8428aa04f8 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_012.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of signatures are not imported together with port types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a port type: signatures + +module NegSem_08020301_GeneralFormatOfImport_012 { +import from NegSem_08020301_GeneralFormatOfImport_012_import { type P }; + // MySignature should be undefined, because it is not automatically imported + template MySignature s_test := { p_par1 := 1 }; +} + +module NegSem_08020301_GeneralFormatOfImport_012_import { + //type integer MyType; + signature MySignature (in integer p_par1) return integer; + type port P procedure { + inout MySignature + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_013.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08757ea6abe528f6094384def6d5871cf7bf6b56 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_013.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of constant types are not imported together with component types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a component type: constant types + +module NegSem_08020301_GeneralFormatOfImport_013 { +import from NegSem_08020301_GeneralFormatOfImport_013_import { type C }; + // MyType should be undefined, because it is not automatically imported + template MyType s_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_013_import { + type integer MyType; + type component C { + const MyType cc_test := 0; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_014.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8da9e44d1080f743286925b82c608dda235b9fef --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_014.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of variable types are not imported together with component types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a component type: variable types + +module NegSem_08020301_GeneralFormatOfImport_014 { +import from NegSem_08020301_GeneralFormatOfImport_014_import { type C }; + // MyType should be undefined, because it is not automatically imported + template MyType s_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_014_import { + type integer MyType; + type component C { + var MyType vc_test := 0; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_015.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e617bf3a86aab99672e2a4e9bc368dab8d1d661c --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_015.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of port types are not imported together with component types + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a component type: port types + +module NegSem_08020301_GeneralFormatOfImport_015 { +import from NegSem_08020301_GeneralFormatOfImport_015_import { type C }; + // P should be undefined, because it is not automatically imported + type component GeneralComponent { + port P p2; + } +} + +module NegSem_08020301_GeneralFormatOfImport_015_import { + type port P message { + inout integer + } + type component C { + port P p1; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_016.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9bc4789929836eb940b8dda66f7a9753fbfd3a47 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_016.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with signatures + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. + +module NegSem_08020301_GeneralFormatOfImport_016 { +import from NegSem_08020301_GeneralFormatOfImport_016_import { signature S }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_016_import { + type integer MyType; + signature S(in MyType p1); +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_017.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d9d904980de0ee4f83d007924b80b67ff7e0e92 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_017.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of return types are not imported together with signatures + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature: return type + +module NegSem_08020301_GeneralFormatOfImport_017 { +import from NegSem_08020301_GeneralFormatOfImport_017_import { signature S }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_017_import { + type integer MyType; + signature S() return MyType; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_018.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31e6f6876da47dba529a6d22d70e1883ac8353ca --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_018.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of exception types are not imported together with signatures + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature: types of exceptions + +module NegSem_08020301_GeneralFormatOfImport_018 { +import from NegSem_08020301_GeneralFormatOfImport_018_import { signature S }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_018_import { + type integer MyType; + signature S() exception (MyType); +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_019.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a3aa58b39ece12a0e0603916257970c8808b1fa --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_019.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of template types are not imported together with data templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a data template: template type + +module NegSem_08020301_GeneralFormatOfImport_019 { +import from NegSem_08020301_GeneralFormatOfImport_019_import { template m_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_019_import { + type integer MyType; + template MyType m_test := ?; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_020.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45fda00696b2a3a080e1e22b17cc8f59a5739379 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_020.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with data templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a data template: parameter types + +module NegSem_08020301_GeneralFormatOfImport_020 { +import from NegSem_08020301_GeneralFormatOfImport_020_import { template m_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_020_import { + type integer MyType; + template integer m_test (MyType p1) := (0..p1); +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_021.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ce09fe1db6a5de42ee978daf47c8eb8396199a2 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_021.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of constants are not imported together with data templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a data template: constants + +module NegSem_08020301_GeneralFormatOfImport_021 { +import from NegSem_08020301_GeneralFormatOfImport_021_import { template m_test }; + // c_test should be undefined, because it is not automatically imported + const integer c_test2 := c_test; +} + +module NegSem_08020301_GeneralFormatOfImport_021_import { + const integer c_test := 1; + template integer m_test := c_test; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_022.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0fb9b8468d6215291b45b464b9d608b4655694a --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_022.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of module parameters are not imported together with data templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a data template: module parameters + +module NegSem_08020301_GeneralFormatOfImport_022 { +import from NegSem_08020301_GeneralFormatOfImport_022_import { template m_test }; + // PX_TEST should be undefined, because it is not automatically imported + const integer c_test := PX_TEST; +} + +module NegSem_08020301_GeneralFormatOfImport_022_import { + modulepar integer PX_TEST := 1; + template integer m_test := PX_TEST; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_023.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf724e12572215cbb0fb8bd061e079103d34e043 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_023.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of functions are not imported together with data templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a data template: functions + +module NegSem_08020301_GeneralFormatOfImport_023 { +import from NegSem_08020301_GeneralFormatOfImport_023_import { template m_test }; + // f_test should be undefined, because it is not automatically imported + const integer c_test := f_test(); +} + +module NegSem_08020301_GeneralFormatOfImport_023_import { + function f_test() return integer { + return 1; + } + template integer m_test := f_test(); +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_024.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2eaafd12ccdd8fb359cdcf93a9b18f738ea6387 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_024.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of signatures are not imported together with signature templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature template: signatures + +module NegSem_08020301_GeneralFormatOfImport_024 { +import from NegSem_08020301_GeneralFormatOfImport_024_import { template s_test }; + // f_test should be undefined, because it is not automatically imported + template S s_test2 := { p := ? } +} + +module NegSem_08020301_GeneralFormatOfImport_024_import { + signature S(integer p); + template S s_test := { p := 3 } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_025.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..313c2080cd633f4ba5dac53297091ae1a02a4c00 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_025.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of constants are not imported together with signature templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature template: constants + +module NegSem_08020301_GeneralFormatOfImport_025 { +import from NegSem_08020301_GeneralFormatOfImport_025_import { template s_test }; + // c_test should be undefined, because it is not automatically imported + const integer c_test2 := c_test; +} + +module NegSem_08020301_GeneralFormatOfImport_025_import { + const integer c_test := 1; + signature S(integer p); + template S s_test := { p := c_test } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_026.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8938027bfe4cf207371f5476b5618751d81a9149 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_026.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of module parameters are not imported together with signature templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature template: module parameters + +module NegSem_08020301_GeneralFormatOfImport_026 { +import from NegSem_08020301_GeneralFormatOfImport_026_import { template s_test }; + // PX_TEST should be undefined, because it is not automatically imported + const integer c_test := PX_TEST; +} + +module NegSem_08020301_GeneralFormatOfImport_026_import { + modulepar integer PX_TEST := 1; + signature S(integer p); + template S s_test := { p := PX_TEST }; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_027.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3333465a581ff15e8661e7951b6829626256bd41 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_027.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of functions are not imported together with signature templates + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a signature template: functions + +module NegSem_08020301_GeneralFormatOfImport_027 { +import from NegSem_08020301_GeneralFormatOfImport_027_import { template s_test }; + // f_test should be undefined, because it is not automatically imported + const integer c_test := f_test(); +} + +module NegSem_08020301_GeneralFormatOfImport_027_import { + function f_test() return integer { + return 1; + } + signature S(integer p); + template S s_test := { p := f_test() } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_028.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..719c1d189c1ad0d0ba9d4c5d5f32604599f1ef18 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_028.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with functions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a function: parameter types + +module NegSem_08020301_GeneralFormatOfImport_028 { +import from NegSem_08020301_GeneralFormatOfImport_028_import { function f_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_028_import { + type integer MyType; + function f_test(MyType p) { + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_029.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb7beb0b1de94a7f0dcc4e821bc8b06e6ac6d6c3 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_029.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of return type are not imported together with functions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a function: return type + +module NegSem_08020301_GeneralFormatOfImport_029 { +import from NegSem_08020301_GeneralFormatOfImport_029_import { function f_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := f_test(); +} + +module NegSem_08020301_GeneralFormatOfImport_029_import { + type integer MyType; + function f_test() return MyType { + return 1; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_030.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94f6fdd5f15ed8f8b80eea4ed9a88e7e3a2b477e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_030.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of component types are not imported together with functions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a function: component types (runs on) + +module NegSem_08020301_GeneralFormatOfImport_030 { +import from NegSem_08020301_GeneralFormatOfImport_030_import { function f_test }; + // C should be undefined, because it is not automatically imported + testcase TC_01() runs on C { } +} + +module NegSem_08020301_GeneralFormatOfImport_030_import { + type component C {}; + function f_test() runs on C { + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_031.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4f7f1faa39c0f7c789a872ee22a1eb4d6bfdc86 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_031.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with external functions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for an external function: parameter types + +module NegSem_08020301_GeneralFormatOfImport_031 { +import from NegSem_08020301_GeneralFormatOfImport_031_import { function f_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_031_import { + type integer MyType; + external function f_test(MyType p); +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_032.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef8e5351e1751517ec7aeebacbec2b9cff359a62 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_032.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of return type are not imported together with external functions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for an external function: return type + +module NegSem_08020301_GeneralFormatOfImport_032 { +import from NegSem_08020301_GeneralFormatOfImport_032_import { function f_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := f_test(); +} + +module NegSem_08020301_GeneralFormatOfImport_032_import { + type integer MyType; + external function f_test() return MyType; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_033.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aad8cf7feb79fd05d5bb95a6d453da4396c582b3 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_033.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with altsteps + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for an altstep: parameter types + +module NegSem_08020301_GeneralFormatOfImport_033 { +import from NegSem_08020301_GeneralFormatOfImport_033_import { altstep a_test }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_033_import { + type integer MyType; + altstep a_test(MyType p) { + [] any port.receive{} + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_034.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..664267d89683aab44c600f7eeb5497e2c3233a64 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_034.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of component types are not imported together with altsteps + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for an altstep: component types (runs on) + +module NegSem_08020301_GeneralFormatOfImport_034 { +import from NegSem_08020301_GeneralFormatOfImport_034_import { altstep a_test }; + // C should be undefined, because it is not automatically imported + testcase TC_01() runs on C { } +} + +module NegSem_08020301_GeneralFormatOfImport_034_import { + type component C {}; + altstep a_test() runs on C { + [] any port.receive {} + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_035.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cba89c9a87b8e2446a6a13d2ad6dc55fdf40397e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_035.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with test cases + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a test case: parameter types + +module NegSem_08020301_GeneralFormatOfImport_035 { + import from NegSem_08020301_GeneralFormatOfImport_035_import { testcase TC_01 }; + // MyType should be undefined, because it is not automatically imported + const MyType c_test := 1; +} + +module NegSem_08020301_GeneralFormatOfImport_035_import { + type integer MyType; + type component C {}; + testcase TC_01(MyType p) runs on C { + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_036.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2f70bd24cd166ba15c3916a118db53f6e5da46f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_036.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of component types (runs on) are not imported together with test cases + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a test case: component types (runs on) + +module NegSem_08020301_GeneralFormatOfImport_036 { +import from NegSem_08020301_GeneralFormatOfImport_036_import { testcase TC_01 }; + // C should be undefined, because it is not automatically imported + testcase TC_02() runs on C { } +} + +module NegSem_08020301_GeneralFormatOfImport_036_import { + type component C {}; + testcase TC_01() runs on C { + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_037.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb9362ab495f6fbe2762365465428af54fdc5f15 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_037.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that identifiers of component types (system) are not imported together with test cases + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TTCN-3 import mechanism distinguishes between the identifier of a referenced +// definition and the information necessary for the usage of a referenced definition +// within the imported definition. For the usage, the identifier of a referenced +// definition is not required and therefore not imported automatically. +// Table 8: +// Possible referenced definitions for a test case: component types (system) + +module NegSem_08020301_GeneralFormatOfImport_037 { +import from NegSem_08020301_GeneralFormatOfImport_037_import { testcase TC_01 }; + // C2 should be undefined, because it is not automatically imported + testcase TC_02() runs on C2 { } +} + +module NegSem_08020301_GeneralFormatOfImport_037_import { + type component C1 {}; + type component C2 {}; + testcase TC_01() runs on C1 system C2 { + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_038.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cb5aff566a0a9a5da3a33d92a592a167288294b9 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_038.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that definition from inside an imported function cannot be referenced + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction f: +// When importing a function, altstep or test case the corresponding behaviour +// specifications and all definitions used inside the behaviour specifications +// remain invisible for the importing module. + +module NegSem_08020301_GeneralFormatOfImport_038 { +import from NegSem_08020301_GeneralFormatOfImport_038_import { function f_test }; + // c_test should be undefined, because it is invisible for the importing module + const integer c_test2 := c_test; +} + +module NegSem_08020301_GeneralFormatOfImport_038_import { + function f_test() { + const integer c_test := 1; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_039.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca61a3ded108b28ccead5c61e6a32b1bacdac984 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_039.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that import clause cannot override language tag of imported module + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction g: +// The language specification of the import statement shall not override the language +// specification of the importing module. +// Restriction h: +// The language specification of the import statement shall be identical to the language +// specification of the source module from which definitions are imported provided +// a language specification is defined in the source module. + +module NegSem_08020301_GeneralFormatOfImport_039 { +import from NegSem_08020301_GeneralFormatOfImport_039_import language "TTCN-3:2013" all; + type component GeneralComp {} + + testcase TC_Sem_08020301_GeneralFormatOfImport_039() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_039()); + } +} + +module NegSem_08020301_GeneralFormatOfImport_039_import language "TTCN-3:2012" { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_040.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..605fd54089d4194c0aee761ebf1908ba58993d0b --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSem_08020301_GeneralFormatOfImport_040.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that unsupported language concepts cannot be used when language is set by import clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction h: +// If no [language specification is defined in the source module], the language +// specification in the import statement is taken as the language specification +// of the source module. If the source module uses however language concepts not +// being part of that language specification, this causes an error for the import +// statement. + +module NegSem_08020301_GeneralFormatOfImport_040 { +import from NegSem_08020301_GeneralFormatOfImport_040_import language "TTCN-3:2012" all; + type component GeneralComp {} + + testcase TC_Sem_08020301_GeneralFormatOfImport_040() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } + } + + control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_040()); + } +} + +module NegSem_08020301_GeneralFormatOfImport_040_import { + type set of integer SoI; + template SoI m_src := {1, 2, 3}; + // all from is a TTCN-3:2013 feature: it shall cause an import error + template integer m_test := ( 10, all from m_src ); + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c163c06ea4c52cf76113600e83d3e0fec5150ad2 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that import statement cannot be used in test case blocks + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction a: +// An import statement shall only be used in the module definitions part and not be used +// within a control part, function definition, and alike. + +module NegSyn_08020301_GeneralFormatOfImport_001 { + + +type component GeneralComp {} + +testcase TC_NegSyn_08020301_GeneralFormatOfImport_001() runs on GeneralComp { + import from NegSyn_08020301_GeneralFormatOfImport_001_import all; + log(c_test); + setverdict(pass); +} + +control{ + execute(TC_NegSyn_08020301_GeneralFormatOfImport_001()); +} +} + +module NegSyn_08020301_GeneralFormatOfImport_001_import { + const integer c_test := 5; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24fbb1060de263bd81db7d7e3dbf04101231f097 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/NegSyn_08020301_GeneralFormatOfImport_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that import statement cannot be used in module control part + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction a: +// An import statement shall only be used in the module definitions part and not be used +// within a control part, function definition, and alike. + +module NegSyn_08020301_GeneralFormatOfImport_002 { + + +type component GeneralComp {} + +testcase TC_NegSyn_08020301_GeneralFormatOfImport_002() runs on GeneralComp { + setverdict(pass); +} + +control{ + import from NegSyn_08020301_GeneralFormatOfImport_002_import all; + log(c_test); + execute(TC_NegSyn_08020301_GeneralFormatOfImport_002()); +} + +} + +module NegSyn_08020301_GeneralFormatOfImport_002_import { + const integer c_test := 5; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3094f9ed4062de67b3235b49b6038434300a8599 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that transitive imports are properly handled + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020301_GeneralFormatOfImport_001 { + +import from Sem_08020301_GeneralFormatOfImport_001_import { import all }; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_001()); +} +} + +module Sem_08020301_GeneralFormatOfImport_001_import { + public import from Sem_08020301_GeneralFormatOfImport_001_import_2 all; +} + + +module Sem_08020301_GeneralFormatOfImport_001_import_2 { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e23ecd318f1bfb8e32a5b42dbead045e7e47c07 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_002.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that enumerated type definitions are automatically imported when needed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020301_GeneralFormatOfImport_002 { + +import from Sem_08020301_GeneralFormatOfImport_002_import { + modulepar px_enum; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_002() runs on GeneralComp { + + if (px_enum == enumX) { //this must be a recognized enum value + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_002()); +} +} + +module Sem_08020301_GeneralFormatOfImport_002_import { + import from Sem_08020301_GeneralFormatOfImport_002_import_2 all; + + modulepar EnumType px_enum:=enumX; +} + + +module Sem_08020301_GeneralFormatOfImport_002_import_2 { + type enumerated EnumType {enumX, enumY, enumZ}; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58d86ae3d8ffc04236c7ca4a958656310c020599 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that local definition takes precedence over imported one when their identifiers are equal + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Name clashes may occur due to import, e.g. import from different modules. Name clashes +// shall be resolved using qualified name(s) for the imported definition(s), i.e. prefixing +// the imported definition (which causes the name clash) by the identifier of the module in +// which it has been defined; the prefix and the identifier shall be separated by a dot ("."). + +module Sem_08020301_GeneralFormatOfImport_003 { + +import from Sem_08020301_GeneralFormatOfImport_003_import all; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_003() runs on GeneralComp { + if (c_myconst == -1) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +const integer c_myconst := -1; + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_003()); +} +} + +module Sem_08020301_GeneralFormatOfImport_003_import +{ + const integer c_myconst := 43532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71aefcce6c6f24cdf14dc2e1b1259a35e9ebfdc2 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_004.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that imported enumeration values take precedence over local definition + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// There is one exception to this rule: when in the context of an enumerated type +// (see clause 6.2.4), an enumerated value is clashing with the name of a definition in +// the importing module, the enumerated value shall take precedence and the definition +// in the importing module shall be referenced by using its qualified name. + +module Sem_08020301_GeneralFormatOfImport_004 { + +import from Sem_08020301_GeneralFormatOfImport_004_import all; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_004() runs on GeneralComp { + var integer enumX := 1; + if (c_enumVal == enumX) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_004()); +} +} + +module Sem_08020301_GeneralFormatOfImport_004_import +{ + type enumerated EnumType {enumX, enumY, enumZ}; + const EnumType c_enumVal := enumX; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_005.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..658df9f6c68a549d4609fd8aec668b1d9f7f8935 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_005.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that it is possible to use module prefix for local definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When the definition is referenced in the same module where it is defined, the +// module identifier of the module (the current module) also may be used for prefixing +// the identifier of the definition. + +module Sem_08020301_GeneralFormatOfImport_005 { + +type component GeneralComp {} +const integer c_test := 5; + +testcase TC_Sem_08020301_GeneralFormatOfImport_005() runs on GeneralComp { + log(Sem_08020301_GeneralFormatOfImport_005.c_test); + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_005()); +} +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_006.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4e53ec3e511c9a8bf2163fd8e3729dc06c4e77c --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_006.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that it is possible to use module prefix for local definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When the definition is referenced in the same module where it is defined, the +// module identifier of the module (the current module) also may be used for prefixing +// the identifier of the definition. + +module Sem_08020301_GeneralFormatOfImport_006 { + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_006() runs on GeneralComp { + var integer c_test := 5; + log(Sem_08020301_GeneralFormatOfImport_006.c_test); + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_006()); +} +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_007.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b2cc07f7acb84a59cb0c818af7b45818b3a1c74 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_007.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Make sure that it is possible to use module prefix for imported definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Name clashes shall be resolved using qualified name(s) for the imported definition(s), +// i.e. prefixing the imported definition by the identifier of the module in which it has +// been defined; the prefix and the identifier shall be separated by a dot ("."). +// In cases where there are no ambiguities the prefixing need not (but may) be present +// when the imported definitions are used. + +module Sem_08020301_GeneralFormatOfImport_007 { + +import from Sem_08020301_GeneralFormatOfImport_007_import all; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_007() runs on GeneralComp { + log(Sem_08020301_GeneralFormatOfImport_007_import.c_test); + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_007()); +} +} + +module Sem_08020301_GeneralFormatOfImport_007_import +{ + const integer c_test := 5; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_008.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..516989cf95e520ccb60bd853b46dab708a9105e5 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_008.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that structured type is imported together with its field names and nested type definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// User-defined type, structured type + +module Sem_08020301_GeneralFormatOfImport_008 { + +import from Sem_08020301_GeneralFormatOfImport_008_import { type R, U }; + +type component GeneralComp {} + +type U.variant1 Test; // test if nested type is imported + +testcase TC_Sem_08020301_GeneralFormatOfImport_008() runs on GeneralComp { + var Test v_test1 := { subfield1 := 1, subfield2 := 2 } + var R v_test2; + // test if field names are imported and type information is avaiable (necessary for + // compatibility check during assignment + v_test2.field1 := 1; + v_test2.field2 := 2; + log (v_test1); + log (v_test2); + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_008()); +} +} + +module Sem_08020301_GeneralFormatOfImport_008_import +{ + type record R { + integer field1, + integer field2 + } + + type union U { + set { + integer subfield1, + integer subfield2 + } variant1, + integer variant2 + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_009.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13046d39b44c7fd6da175f908044fa666f36ec83 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_009.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that component type is imported together with constant, variable, timer and port names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// User-defined type, component type + +module Sem_08020301_GeneralFormatOfImport_009 { + +import from Sem_08020301_GeneralFormatOfImport_009_import { type GeneralComp }; + +testcase TC_Sem_08020301_GeneralFormatOfImport_009() runs on GeneralComp { + // type compatibility is checked during assignment: + // for this check, type information for constant and variable types + // should be available at this point to compile the script correctly + var integer v_test; + v_test := cc_test; // testing constant reference + log(v_test); + v_test := vc_test; // testing variable reference + log(v_test); + tc_test.start; // testing timer reference + p1.start; // testing port reference + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_009()); +} +} + +module Sem_08020301_GeneralFormatOfImport_009_import +{ + type port P message { + inout integer; + } + type component GeneralComp + { + const integer cc_test := 0; + var integer vc_test := 1; + timer tc_test := 1.0; + port P p1; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_010.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7cf5629b5c22aeb191783d5e8576ff653b4b83f9 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_010.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that signature is imported together with parameter names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Signature + +module Sem_08020301_GeneralFormatOfImport_010 { + +import from Sem_08020301_GeneralFormatOfImport_010_import { signature Signature1 }; + +type component GeneralComp {} + +// type compatibility is checked during parameter passing: for this check, type +// information for the signature parameters should be available at this point +// to compile the script correctly +template Signature1 s_test := { + p_param1 := 1 // testing signature parameter name +} + +testcase TC_Sem_08020301_GeneralFormatOfImport_010() runs on GeneralComp { + log (s_test); + setverdict(pass); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_010()); +} +} + +module Sem_08020301_GeneralFormatOfImport_010_import +{ + signature Signature1 (in integer p_param1); +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_011.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42fa328818d5a216f23e59784c6355c546647d6a --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_011.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that parameterized template is imported together with parameter names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Data template + +module Sem_08020301_GeneralFormatOfImport_011 { + +import from Sem_08020301_GeneralFormatOfImport_011_import { type R; template m_test1 }; + +type component GeneralComp {} + +type record RLocal { // compatible type with Sem_08020301_GeneralFormatOfImport_011_import.R + integer field1, + integer field2 +} +testcase TC_Sem_08020301_GeneralFormatOfImport_011() runs on GeneralComp { + + // type compatibility is checked during parameter passing and template assignment: + // for this check, type information for the template parameters and template type + // should be available at this point to compile the script correctly + template RLocal m_res := m_test1(p_param2 := 10); + if (match({1, 10}, m_res)) // testing if parameter name is imported + { setverdict(pass); } + else + { setverdict(fail); } +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_011()); +} +} + +module Sem_08020301_GeneralFormatOfImport_011_import { + type record R { + integer field1, + integer field2 + } + template R m_test1(integer p_param1 := 1 , integer p_param2 := 2) := { + field1 := p_param1, + field2 := p_param2 + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_012.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d4fb8244a16cab27a8992f52f7bb01f42daba59 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_012.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that function is imported together with parameter names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Function + +module Sem_08020301_GeneralFormatOfImport_012 { + +import from Sem_08020301_GeneralFormatOfImport_012_import { function f_div }; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_012() runs on GeneralComp { + + // testing if function parameter names were imported + // type compatibility is checked during parameter passing and return value assignment: for + // this check, the type information for the function parameters and return values should be + // available at this point to compile the script correctly + var integer v_res := f_div(p_param1 := 10, p_param2 := 5); + if (v_res == 2) + { setverdict(pass); } + else + { setverdict(fail); } +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_012()); +} +} + +module Sem_08020301_GeneralFormatOfImport_012_import { + function f_div(integer p_param1, integer p_param2) return integer { + return p_param1 / p_param2; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_013.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d21f8bf491614885a9b065125dcef9f9bc20a4a --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_013.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that altstep is imported together with parameter names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Altstep + +module Sem_08020301_GeneralFormatOfImport_013 { + +import from Sem_08020301_GeneralFormatOfImport_013_import { altstep a_test }; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_013() runs on GeneralComp { + // testing if parameter names are imported + // type compatibility is checked during parameter passing: for this check, the type information for + // the altstep parameters should be available at this point to compile the script correctly + a_test(p_param2 := 2, p_param1 := 1); +} + +control{ + execute(TC_Sem_08020301_GeneralFormatOfImport_013()); +} +} + +module Sem_08020301_GeneralFormatOfImport_013_import { + altstep a_test(integer p_param1, integer p_param2) { + [] any timer.timeout {} + [else] { + if ( match(p_param1, 1) and match(p_param2, 2) ) { setverdict(pass); } + else { setverdict(fail); } + } + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_014.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2af3bbf534d5923b9e40aac3f33f33b8870e348a --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_014.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that test case is imported together with parameter names + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// A definition is imported together with its name and all local definitions. +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Test case + +module Sem_08020301_GeneralFormatOfImport_014 { + +import from Sem_08020301_GeneralFormatOfImport_014_import { testcase TC_Sem_08020301_GeneralFormatOfImport_014 }; + +control{ + // testing if parameter names are imported + // type compatibility is checked during parameter passing: for this check, the type information for + // the test case parameters should be available at this point to compile the script correctly + execute(TC_Sem_08020301_GeneralFormatOfImport_014(p_param2 := 2, p_param1 := 1)); +} +} + +module Sem_08020301_GeneralFormatOfImport_014_import { + type component GeneralComp {} + testcase TC_Sem_08020301_GeneralFormatOfImport_014(integer p_param1, integer p_param2) runs on GeneralComp { + if ( match(p_param1, 1) and match(p_param2, 2)) { setverdict(pass); } + else { setverdict(fail); } + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_015.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8540b498392e5cbb154e6f2af4b96692cd64469 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_015.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that information about module parameter type is imported together with module parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Module parameter + +module Sem_08020301_GeneralFormatOfImport_015 { + +import from Sem_08020301_GeneralFormatOfImport_015_import { modulepar PX_TEST }; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_015() runs on GeneralComp { + // type compatibility is checked during assignment: for this check, the type information for PX_TEST + // should be available at this point to compile the script correctly + var integer v_test := PX_TEST; + if (v_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_015()); +} +} + +module Sem_08020301_GeneralFormatOfImport_015_import { + modulepar integer PX_TEST := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_016.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8de78631c249f78088c08648c4e1d73370f7afd --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_016.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that information about type of constant is imported together with constant + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction d: +// A definition is imported together with all information of referenced definitions that +// are necessary for the usage of the imported definition, independent of the visibility +// of the referenced definitions. +// Table 8: +// Possible referenced definitions for a signature: parameter types + +module Sem_08020301_GeneralFormatOfImport_016 { + +import from Sem_08020301_GeneralFormatOfImport_016_import { const c_test }; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_016() runs on GeneralComp { + // type compatibility is checked during assignment: for this check, the type information for c_test + // should be available at this point to compile the script correctly + var integer v_test := c_test; + if (v_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_016()); +} +} + +module Sem_08020301_GeneralFormatOfImport_016_import { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_017.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b1ffdb83de0d4e973c9f9a25666b70291af410b --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_017.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify using of import clause with language tag for impoting module having identical language tag + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction h: +// The language specification of the import statement shall be identical to the language +// specification of the source module from which definitions are imported provided +// a language specification is defined in the source module. + +module Sem_08020301_GeneralFormatOfImport_017 { + +import from Sem_08020301_GeneralFormatOfImport_017_import language "TTCN-3:2013" all; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_017() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_017()); +} +} + +module Sem_08020301_GeneralFormatOfImport_017_import language "TTCN-3:2013" { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_018.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c9c5d50a301a2ff25b5ee9214874564ba6a7823f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_018.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify using of import clause with language tag for impoting module with no language tag + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction h: +// The language specification of the import statement shall be identical to the language +// specification of the source module from which definitions are imported provided +// a language specification is defined in the source module. + +module Sem_08020301_GeneralFormatOfImport_018 { + +import from Sem_08020301_GeneralFormatOfImport_018_import language "TTCN-3:2013" all; + +type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_018() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_018()); +} +} + +module Sem_08020301_GeneralFormatOfImport_018_import { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_019.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8de3c5cea8b2e3250298d0566a0593be14eff48f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_019.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that type of port is imported from a module as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +/*If the type of the component referenced in a connection operation is known (either when the component reference is a +variable or value returned from a function or the type is defined the runs on, mtc or system clause of the calling +function), the referenced port declaration shall be present in this component type.*/ + +module Sem_08020301_GeneralFormatOfImport_019 { + +import from Sem_08020301_GeneralFormatOfImport_019_import all; + + type component GeneralComp { + port loopbackPort messagePort + } + +testcase TC_Sem_08020301_GeneralFormatOfImport_019() runs on GeneralComp { + + var My_int v_int := 2; //type reference from other module + messagePort.send(v_int); //send message + + alt { + [] messagePort.receive(v_int) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_019()); +} +} + +module Sem_08020301_GeneralFormatOfImport_019_import { + type integer My_int; + type port loopbackPort message{inout My_int}; + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_020.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c82714527c4cddc6421f252d92a0a6b2b667e4e8 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Sem_08020301_GeneralFormatOfImport_020.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Verify that prefixed type is evaluated as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +/*In cases where there are no ambiguities the prefixing need not (but may) be present when the imported definitions are +used. When the definition is referenced in the same module where it is defined, the module identifier of the module (the +current module) also may be used for prefixing the identifier of the definition.*/ + +module Sem_08020301_GeneralFormatOfImport_020 { + + import from Sem_08020301_GeneralFormatOfImport_020_import {type My_type}; + + type float My_type; //float type + + type component GeneralComp {} + +testcase TC_Sem_08020301_GeneralFormatOfImport_020() runs on GeneralComp { + + var My_type v_1 := 2.5; //prefixed type + var Sem_08020301_GeneralFormatOfImport_020_import.My_type v_2 := 1; //prefix and the identifier + + if( (match(v_1,2.5)) and (match(v_2,1))) + { + setverdict(pass); + } else { + setverdict(fail); + } + +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020301_GeneralFormatOfImport_020()); +} +} + +module Sem_08020301_GeneralFormatOfImport_020_import { + type integer My_type; //integer type + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1aac38f4215b16c3298389cb151913141e401c7 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_001.ttcn @@ -0,0 +1,15 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that import all is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_08020301_GeneralFormatOfImport_001 { + import from Syn_08020301_GeneralFormatOfImport_001_import all; +} + +module Syn_08020301_GeneralFormatOfImport_001_import { + const integer c_myconst := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2052793d1d9ca27b35731d4acc4d704a697c2097 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020301_general_format_of_import/Syn_08020301_GeneralFormatOfImport_002.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.1, Ensure that import of specific types is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_08020301_GeneralFormatOfImport_002 { + import from Syn_08020301_GeneralFormatOfImport_002_import { + type all; + template all; + const c_myconst; + testcase all; + altstep all; + function all; + signature all; + modulepar all; + }; + +} + +module Syn_08020301_GeneralFormatOfImport_002_import { + const integer c_myconst := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e40aac8750abae132c8c2a608745621f1b146db --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.2, Ensure that the value of an explicitly imported constant can be read and carries the same value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020302_ImportingSingleDefinitions_001 { + +import from Sem_08020302_ImportingSingleDefinitions_001_import { + const c_myconst; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020302_ImportingSingleDefinitions_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020302_ImportingSingleDefinitions_001()); +} +} + +module Sem_08020302_ImportingSingleDefinitions_001_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..838a3df40a371a06ddb995d0fbdc7371bc52f5ff --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020302_importing_single_definitions/Sem_08020302_ImportingSingleDefinitions_002.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.2, Ensure that the value of an explicitly imported template can be read and carries the same value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020302_ImportingSingleDefinitions_002 { + + import from Sem_08020302_ImportingSingleDefinitions_002_import { + template m_myTemplate; + }; + + type component GeneralComp {} + type record MyMessageType2 { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_Sem_08020302_ImportingSingleDefinitions_002() runs on GeneralComp { + var MyMessageType2 v_value:={23521, "My String", true}; + + if (match(v_value, m_myTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_08020302_ImportingSingleDefinitions_002()); + } +} + +module Sem_08020302_ImportingSingleDefinitions_002_import { + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + template MyMessageType m_myTemplate := { + field1 := 23521, + field2 := "My String", + field3 := true + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/NegSem_08020303_ImportingGroups_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/NegSem_08020303_ImportingGroups_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de180b97488b9929b8bf46523121b784f0342805 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/NegSem_08020303_ImportingGroups_001.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.3, Ensure that constants listed as exceptions in imported groups are not accessible. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_08020303_ImportingGroups_001 { + +import from NegSem_08020303_ImportingGroups_001 { + group CONST_GROUP except { + const c_myotherconst; + } +}; +type component GeneralComp {} +testcase TC_NegSem_08020303_ImportingGroups_001() runs on GeneralComp { + if ( match(c_myotherconst, 123456) ) { // c_myotherconst is excluded and shall not be accessible + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_08020303_ImportingGroups_001()); +} +} + +module NegSem_08020303_ImportingGroups_001_import { + group CONST_GROUP { + const integer c_myconst := 43532; + const integer c_myotherconst := 123456; + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49869c725ba61bd23dec2ad326ee6be3a4b3af7e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_001.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.3, Ensure that a const defined in a group can be accessed if the group is imported. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020303_ImportingGroups_001 { + +import from Sem_08020303_ImportingGroups_001_import { + group CONST_GROUP; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020303_ImportingGroups_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020303_ImportingGroups_001()); +} +} + +module Sem_08020303_ImportingGroups_001_import { + group CONST_GROUP { + const integer c_myconst := 43532; + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa5bff348ff96fce1acd315a439f43a75ec296fb --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_002.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.3, Ensure that the IUT properly handles 'except' clause in group import definitions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_08020303_ImportingGroups_002 { + +import from Sem_08020303_ImportingGroups_002_import { + group CONST_GROUP except { + const c_myconst; + }; + const all; + group CONST_INNER_GROUP except { + const c_myconst; + }; +} + +type component GeneralComp {} + +testcase TC_Sem_08020303_ImportingGroups_002() runs on GeneralComp { + if (c_myconst == 43532) { // c_myconst shall be imported from const all;, the exception must not removed it from the imports. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020303_ImportingGroups_002()); +} +} + +module Sem_08020303_ImportingGroups_002_import { + group CONST_GROUP { + group CONST_INNER_GROUP { + const integer c_myconst := 43532; + } + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d80362f1f623870873822bc1da90ebb9cf43070 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020303_importing_groups/Sem_08020303_ImportingGroups_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.3, but that it is in fact a shortcut notation for explicit imports. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_08020303_ImportingGroups_003 { + + import from Sem_08020303_ImportingGroups_003_import { + group CONST_GROUP.CONST_INNER_GROUP except { + const c_myconst; + }; + const all; + } + + type component GeneralComp {} + + testcase TC_Sem_08020303_ImportingGroups_003() runs on GeneralComp { + if (c_myconst == 43532) { // c_myconst shall be imported from const all;, the exception must not removed it from the imports. + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_08020303_ImportingGroups_003()); + } +} + +module Sem_08020303_ImportingGroups_003_import { + group CONST_GROUP { + group CONST_INNER_GROUP { + const integer c_myconst := 43532; + } + } +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ee050cc9eccfc6742f974a8769d9ae6f8e82064 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that an import of all constants allows access to a sample constant. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_001 { + +import from Sem_08020304_ImportingDefinitionsOfTheSameKind_001_import { + const all; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_001()); +} +} + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_001_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58c8d3b71112bb546427fc495298c9536b476ad0 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that a previously valid const import is not removed by an import covering the same definition with an except. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_002 { + +import from Sem_08020304_ImportingDefinitionsOfTheSameKind_002_import { + const all; + const all except c_myconst; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_002() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_002()); +} +} + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_002_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b1768fc15e50c739c96b5e002c160fcc0bd3987 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020304_importing_definitions_of_the_same_kind/Sem_08020304_ImportingDefinitionsOfTheSameKind_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.4, Ensure that a previously valid const import is not removed by a second import statement excluding the same definition. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_003 { + +import from Sem_08020304_ImportingDefinitionsOfTheSameKind_003_import all; +import from Sem_08020304_ImportingDefinitionsOfTheSameKind_003_import { + const all except c_myconst; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_003() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020304_ImportingDefinitionsOfTheSameKind_003()); +} +} + +module Sem_08020304_ImportingDefinitionsOfTheSameKind_003_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a729bea7d430df28729ddaa600305f31b01d8e1 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, Ensure that the constant is not visible after import with except. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_08020305_ImportingAllDefinitionsOfAModule_001 { + +import from NegSem_08020305_ImportingAllDefinitionsOfAModule_001_import all except { +// everything is excluded again + group all; + type all; + template all; + const all; + testcase all; + altstep all; + function all; + signature all; + modulepar all; +}; + +type component GeneralComp {} + +testcase TC_NegSem_08020305_ImportingAllDefinitionsOfAModule_001() runs on GeneralComp { + if (c_myconst == 43532) { // should not be visible due to the const all exception + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_08020305_ImportingAllDefinitionsOfAModule_001()); +} +} + +module NegSem_08020305_ImportingAllDefinitionsOfAModule_001_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76cf23720accf1412c7f4133c1ea7f0ffae229ca --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/NegSem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, Ensure that the constant is not visible after import with except. + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction b +// In the set of except statements for an all import, only one except statement per +// kind of definition (i.e. for a group, type, etc.) is allowed. + +module NegSem_08020305_ImportingAllDefinitionsOfAModule_002 { + +import from NegSem_08020305_ImportingAllDefinitionsOfAModule_002_import all except { +// everything is excluded again + group all; + type all; + template all; + const c_test1; + testcase all; + altstep all; + function all; + signature all; + modulepar all; + const c_test2; // error: const present more than once in the except part +}; + +type component GeneralComp {} + +testcase TC_NegSem_08020305_ImportingAllDefinitionsOfAModule_002() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_08020305_ImportingAllDefinitionsOfAModule_002()); +} +} + +module NegSem_08020305_ImportingAllDefinitionsOfAModule_002_import { + const integer c_myconst := 43532; + const integer c_test1 := 0; + const integer c_test2 := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eafacfe10395824fbb7f1ca3d5ecc8a7534c1c6c --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, Ensure that the constant is be visible after multiple imports. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_08020305_ImportingAllDefinitionsOfAModule_001 { + +import from Sem_08020305_ImportingAllDefinitionsOfAModule_001_import all; + +type component GeneralComp {} + +testcase TC_Sem_08020305_ImportingAllDefinitionsOfAModule_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020305_ImportingAllDefinitionsOfAModule_001()); +} +} + +module Sem_08020305_ImportingAllDefinitionsOfAModule_001_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1230132eb2c827ed6a3f26f278fc655cc29c3a75 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020305_importing_all_definitions_of_a_module/Sem_08020305_ImportingAllDefinitionsOfAModule_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.5, Ensure that the constant is be visible after multiple imports. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_08020305_ImportingAllDefinitionsOfAModule_002 { + +import from Sem_08020305_ImportingAllDefinitionsOfAModule_002_import all except { + const all; +}; +import from Sem_08020305_ImportingAllDefinitionsOfAModule_002_import all; // second import overrides the first + +type component GeneralComp {} + +testcase TC_Sem_08020305_ImportingAllDefinitionsOfAModule_002() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020305_ImportingAllDefinitionsOfAModule_002()); +} +} + +module Sem_08020305_ImportingAllDefinitionsOfAModule_002_import { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..799c513e5cb56b48e6184981061015e11b67b5e7 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:8.2.3.6, Ensure that it is possible to import from previous language versions. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001 language "TTCN-3:2010" { + import from Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001_import language "TTCN-3:2003" { + const all; + } +} + +module Sem_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001_import { + const integer c_myconst := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c89b2dcab3714462f63106786f936e334602edd --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.6, Ensure that imports work with language references when importing definitions of the same kinds (in this case constants) is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001 { + import from Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001_import language "TTCN-3:2003" { + const all; + } +} + +module Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_001_import { + const integer c_myconst := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79084c2b24b115314c0c60b1d3d937aa973efaa5 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020306_importing_definitions_from_other_t3_editions_and_non_t3_modules/Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.6, Ensure that imports work with language references when importing all definitions of another module is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002 { + import from Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002_import language "TTCN-3:2003" all ; +} + +module Syn_08020306_ImportingDefinitionsFromOtherT3EditionsAndFromNonT3Modules_002_import { + const integer c_myconst := 1; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1db3ec13d1e74cf64060dfcdf2b10efc2c67131d --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.7, Ensure that the import of import statements works for import all. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001 { + +import from NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001_importA { + import all; +}; + +type component GeneralComp {} + +testcase TC_NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001() runs on GeneralComp { + if (c_myconst == 43532) { // c_myconst shall not be accessible as the import in the importA module is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001()); +} +} + +module NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001_importA { + private import from NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001_importB all; +} + +module NegSem_08020307_ImportingOfImportStatementsFromT3Modules_001_importB { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d2b50e9f27a616f0101fef2764022deeae75afb --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.7, Ensure that the import of import statements works for import all. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002 { + +import from Sem_08020307_ImportingOfImportStatementsFromT3Modules_002_importA { + import all; +}; + +type component GeneralComp {} + +testcase TC_NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002() runs on GeneralComp { + if (c_myconst == 43532) { // c_myconst shall not be accessible as the import in the importA module is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002()); +} +} + +module Sem_08020307_ImportingOfImportStatementsFromT3Modules_002_importA { + // imports are private by default + import from NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002_importB all; +} + +module NegSem_08020307_ImportingOfImportStatementsFromT3Modules_002_importB { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/Sem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/Sem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..125a9dc060d6e8653072733dd61d0eaa4adc5cac --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020307_importing_of_import_statements_from_t3_modules/Sem_08020307_ImportingOfImportStatementsFromT3Modules_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.7, Ensure that the import of import statements works for import all. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_08020307_ImportingOfImportStatementsFromT3Modules_001 { + +import from Sem_08020307_ImportingOfImportStatementsFromT3Modules_001_importA { + import all; +}; + +type component GeneralComp {} + +testcase TC_Sem_08020307_ImportingOfImportStatementsFromT3Modules_001() runs on GeneralComp { + if (c_myconst == 43532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_08020307_ImportingOfImportStatementsFromT3Modules_001()); +} +} + +module Sem_08020307_ImportingOfImportStatementsFromT3Modules_001_importA { + public import from Sem_08020307_ImportingOfImportStatementsFromT3Modules_001_importB all; +} + +module Sem_08020307_ImportingOfImportStatementsFromT3Modules_001_importB { + const integer c_myconst := 43532; +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NOTES b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..a452036a95bccef798f18db854d173cc5e81b68f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NOTES @@ -0,0 +1,3 @@ +- NOTE: imports of compatible external definitions is not easily possible with TTCN-3 alone. + Therefore, the amount of tests possible in this section is highly limited. +- Restriction b is tested as a part of 8.2.3.1 \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22f6d56bc5f4942339e9f5b3abd8abcd11a6a6f0 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.3.8, Ensure that imports referring to future TTCN-3 versions are rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001 { + +import from NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001_import_A language "TTCN-3:9000" all; // shall be rejected as the cited TTCN-3 version is obviously in the future +} + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_001_import_A { +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91fdea6802c4f23ec63cc7e7354a4af2e0048437 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.8, Verify that modules with explicit language tag cannot import from newer TTCN-3 versions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// The TTCN-3 language specification in an import statement shall be lower or equal +// to the TTCN-3 language specification of the importing module, i.e. a TTCN-3 module +// can only import from earlier or same editions of TTCN-3 but not from later editions. + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002 language "TTCN-3:2012" { + +import from NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002_import language "TTCN-3:2013" all; + +type component GeneralComp {} + +testcase TC_NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002()); +} +} + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_002_import { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54f3072dbc3aa343ea342fa695c4159295e9986e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.8, Verify that modules with explicit language tag cannot import from newer TTCN-3 versions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// The TTCN-3 language specification in an import statement shall be lower or equal +// to the TTCN-3 language specification of the importing module, i.e. a TTCN-3 module +// can only import from earlier or same editions of TTCN-3 but not from later editions. + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003 language "TTCN-3:2012" { + +import from NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003_import all; + +type component GeneralComp {} + +testcase TC_NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003()); +} +} + +module NegSem_08020308_CompatibilityOfLanguageSpecificationsInImports_003_import language "TTCN-3:2013" { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e46b593a82b60ce82f12cee3abf98abb3178754c --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.8, Verify that modules with explicit language tag can import from older TTCN-3 versions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// The TTCN-3 language specification in an import statement shall be lower or equal +// to the TTCN-3 language specification of the importing module, i.e. a TTCN-3 module +// can only import from earlier or same editions of TTCN-3 but not from later editions. + +module Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001 language "TTCN-3:2013" { + +import from Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001_import language "TTCN-3:2012" all; + +type component GeneralComp {} + +testcase TC_Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001()); +} +} + +module Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_001_import { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d7d387d712f99169592dfd4dfc010cfc719a84d --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080203_importing_from_modules/08020308_compatibility_of_language_specifications_in_imports/Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:8.2.3.8, Verify that modules with explicit language tag can import from older TTCN-3 versions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Restriction c: +// The TTCN-3 language specification in an import statement shall be lower or equal +// to the TTCN-3 language specification of the importing module, i.e. a TTCN-3 module +// can only import from earlier or same editions of TTCN-3 but not from later editions. + +module Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002 language "TTCN-3:2013" { + +import from Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002_import all; + +type component GeneralComp {} + +testcase TC_Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002() runs on GeneralComp { + if (c_test == 0) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + // testing if parameter names are imported + execute(TC_Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002()); +} +} + +module Sem_08020308_CompatibilityOfLanguageSpecificationsInImports_002_import language "TTCN-3:2012" { + const integer c_test := 0; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..861ca5b0e7be695e91bd0d5a87148afb74721a7f --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.4, Ensure that friend visibility works for a sample constant. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080204_DefinitionOfFriendModules_001 { + +import from NegSem_080204_DefinitionOfFriendModules_001_import all; + +type component GeneralComp {} + +testcase TC_NegSem_080204_DefinitionOfFriendModules_001() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible. A friend module statement is missing in NegSem_080204_DefinitionOfFriendModules_001_import. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080204_DefinitionOfFriendModules_001()); +} +} + +module NegSem_080204_DefinitionOfFriendModules_001_import { + friend const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31df53a8f7886a0a997e859d727732d91dfda1d0 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/NegSem_080204_DefinitionOfFriendModules_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.4, Ensure that private definitions are not made visible by friend declarations (for a constant sample definition). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080204_DefinitionOfFriendModules_002 { + +import from NegSem_080204_DefinitionOfFriendModules_002_import all; + +type component GeneralComp {} + +testcase TC_NegSem_080204_DefinitionOfFriendModules_002() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible. The definition is private even though the module is a friend. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080204_DefinitionOfFriendModules_002()); +} +} + +module NegSem_080204_DefinitionOfFriendModules_002_import { + friend module NegSem_080204_DefinitionOfFriendModules_001; + + private const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/Sem_080204_DefinitionOfFriendModules_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/Sem_080204_DefinitionOfFriendModules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d96e48edd0fd2d0da38c80f43b13c822703a41e9 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080204_definition_of_friend_modules/Sem_080204_DefinitionOfFriendModules_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.4, Ensure that friend visibility works for a sample constant. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080204_DefinitionOfFriendModules_001 { + +import from Sem_080204_DefinitionOfFriendModules_001_import all; + +type component GeneralComp {} + +testcase TC_Sem_080204_DefinitionOfFriendModules_001() runs on GeneralComp { + if (c_myconst == 32532) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080204_DefinitionOfFriendModules_001()); +} +} + +module Sem_080204_DefinitionOfFriendModules_001_import { + friend module Sem_080204_DefinitionOfFriendModules_001; + + friend const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7ea8efe6da050f2ea0967a245a720933dbe2fb7 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that private definition (in this case a sample constant) is not visible using a normal import. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080205_VisibilityOfDefinitions_001 { + +import from NegSem_080205_VisibilityOfDefinitions_001_import all; + +type component GeneralComp {} + +testcase TC_NegSem_080205_VisibilityOfDefinitions_001() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible on import as the definition is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080205_VisibilityOfDefinitions_001()); +} +} + +module NegSem_080205_VisibilityOfDefinitions_001_import { + private const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26823e27a5d72a7a8f1a3bbba0ab71f9cebb918b --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that private definition (in this case a sample constant) is not visible using an import of a friend module. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080205_VisibilityOfDefinitions_002 { + +import from NegSem_080205_VisibilityOfDefinitions_002_import all; + +type component GeneralComp {} + +testcase TC_NegSem_080205_VisibilityOfDefinitions_002() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible on import as the definition is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080205_VisibilityOfDefinitions_002()); +} +} + +module NegSem_080205_VisibilityOfDefinitions_002_import { + friend module NegSem_080205_VisibilityOfDefinitions_002; + + private const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3aebd03305eb1665b6f85260e3d510aa34ed66f9 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that friend definition (in this case a sample constant) is not visible using a group import of a non-friend module. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080205_VisibilityOfDefinitions_003 { + +import from NegSem_080205_VisibilityOfDefinitions_003_import { + group CONST_GROUP; +} + +type component GeneralComp {} + +testcase TC_NegSem_080205_VisibilityOfDefinitions_003() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible on import as the definition is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080205_VisibilityOfDefinitions_003()); +} +} + +module NegSem_080205_VisibilityOfDefinitions_003_import { + group CONST_GROUP { + friend const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0ac887ed3748a3654224f9bdbf3fcd2f63c578e --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_004.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that private definition (in this case a sample constant) is not visible using a group import of a non-friend module. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080205_VisibilityOfDefinitions_004 { + +import from NegSem_080205_VisibilityOfDefinitions_004_import { + group CONST_GROUP; +} + +type component GeneralComp {} + +testcase TC_NegSem_080205_VisibilityOfDefinitions_004() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible on import as the definition is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080205_VisibilityOfDefinitions_004()); +} +} + +module NegSem_080205_VisibilityOfDefinitions_004_import { + group CONST_GROUP { + private const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_005.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31638a029c2440d8f215a0f7992e00950b57ebc2 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/NegSem_080205_VisibilityOfDefinitions_005.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that private definition (in this case a sample constant) is not visible using a group import of a friend module. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_080205_VisibilityOfDefinitions_005 { + +import from NegSem_080205_VisibilityOfDefinitions_005_import { + group CONST_GROUP; +} + +type component GeneralComp {} + +testcase TC_NegSem_080205_VisibilityOfDefinitions_005() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall not be visible on import as the definition is private. + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_080205_VisibilityOfDefinitions_005()); +} +} + +module NegSem_080205_VisibilityOfDefinitions_005_import { + friend module NegSem_080205_VisibilityOfDefinitions_005; + + group CONST_GROUP { + private const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99afaef122f5294d77c8a1c35b99791f0d928e74 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that explicitly defined public definitions (in this case a sample constant) are visible when imported. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080205_VisibilityOfDefinitions_001 { + +import from Sem_080205_VisibilityOfDefinitions_001_import all; + +type component GeneralComp {} + +testcase TC_Sem_080205_VisibilityOfDefinitions_001() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall be visible on import when it is explicitly set to public. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080205_VisibilityOfDefinitions_001()); +} +} + +module Sem_080205_VisibilityOfDefinitions_001_import { + public const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0471b107c22383e6d14c9e7f3ab532ee354965bd --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that explicitly defined public definitions (in this case a sample constant) are visible when imported by a friend module. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080205_VisibilityOfDefinitions_002 { + +import from Sem_080205_VisibilityOfDefinitions_002_import all; + +type component GeneralComp {} + +testcase TC_Sem_080205_VisibilityOfDefinitions_002() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall be visible on import when it is explicitly set to public. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080205_VisibilityOfDefinitions_002()); +} +} + +module Sem_080205_VisibilityOfDefinitions_002_import { + friend module Sem_080205_VisibilityOfDefinitions_002; + + public const integer c_myconst := 32532; +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_003.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f249252f27580cee276fe44c1ff5eb154bef3dd --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that explicitly defined public definitions (in this case a sample constant) are visible when imported through a group. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080205_VisibilityOfDefinitions_003 { + +import from Sem_080205_VisibilityOfDefinitions_003_import { + group CONST_GROUP; +}; + +type component GeneralComp {} + +testcase TC_Sem_080205_VisibilityOfDefinitions_003() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall be visible on import when it is explicitly set to public. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080205_VisibilityOfDefinitions_003()); +} +} + +module Sem_080205_VisibilityOfDefinitions_003_import { + group CONST_GROUP { + public const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_004.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4744520f42e6b6aa0e8788f3701c7397870b1990 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_004.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that explicitly defined public definitions (in this case a sample constant) are visible when imported through a group of a friend module. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080205_VisibilityOfDefinitions_004 { + +import from Sem_080205_VisibilityOfDefinitions_004_import { + group CONST_GROUP; +}; + +type component GeneralComp {} + +testcase TC_Sem_080205_VisibilityOfDefinitions_004() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall be visible on import when it is explicitly set to public. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080205_VisibilityOfDefinitions_004()); +} +} + +module Sem_080205_VisibilityOfDefinitions_004_import { + friend module Sem_080205_VisibilityOfDefinitions_004; + + group CONST_GROUP { + public const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_005.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b30105469455de1bbc6cee81d6a1e10d8cd7749 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080205_visibility_of_definitions/Sem_080205_VisibilityOfDefinitions_005.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2.5, Ensure that friend definitions (in this case a sample constant) are visible when imported through a group of a friend module. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_080205_VisibilityOfDefinitions_005 { + +import from Sem_080205_VisibilityOfDefinitions_005_import { + group CONST_GROUP; +}; + +type component GeneralComp {} + +testcase TC_Sem_080205_VisibilityOfDefinitions_005() runs on GeneralComp { + if (c_myconst == 32532) { // c_myconst shall be visible on import when it is explicitly set to public. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_080205_VisibilityOfDefinitions_005()); +} +} + +module Sem_080205_VisibilityOfDefinitions_005_import { + friend module Sem_080205_VisibilityOfDefinitions_005; + + group CONST_GROUP { + friend const integer c_myconst := 32532; + } +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08750d35a2fbea321e1182e044d35ce09215acf8 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_001.ttcn @@ -0,0 +1,15 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2, Ensure that a TypeDef module definition with public visibility is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_0802_ModuleDefinitionsPart_001 { + public type record MyRecord1 { + integer field1, + charstring field2 + } + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_002.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d54609bf8917cebe216ecd2b4804f4c140477ad --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/0802_toplevel/Syn_0802_ModuleDefinitionsPart_002.ttcn @@ -0,0 +1,15 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.2, Ensure that a TypeDef module definition with private visibility is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + + +module Syn_0802_ModuleDefinitionsPart_002 { + private type record MyRecord1 { + integer field1, + charstring field2 + } + +} diff --git a/ATS/core_language/08_modules/0803_module_control_part/NegSyn_0803_ModuleControlPart_001.ttcn b/ATS/core_language/08_modules/0803_module_control_part/NegSyn_0803_ModuleControlPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5ac7a40babc98ab10ec376961022631e4f9459f --- /dev/null +++ b/ATS/core_language/08_modules/0803_module_control_part/NegSyn_0803_ModuleControlPart_001.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.3, Ensure that there is not more than one control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSyn_0803_ModuleControlPart_001 { + +control { + var integer count := 0; +} + +control { + var integer count := 0; +} + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0803_module_control_part/Sem_0803_ModuleControlPart_001.ttcn b/ATS/core_language/08_modules/0803_module_control_part/Sem_0803_ModuleControlPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a57a7e6202312edb83cfed48bc4b0ab6edd8e163 --- /dev/null +++ b/ATS/core_language/08_modules/0803_module_control_part/Sem_0803_ModuleControlPart_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.3, Ensure that the verdict returned from a test case to the control-part does not influence the execution of a second test case. The result of the last test case execution corresponds to the overall test verdict. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_0803_ModuleControlPart_001 { + +type component GeneralComp {} + +testcase TC_Sem_0803_ModuleControlPart_001() runs on GeneralComp { + setverdict(pass); +} + +testcase TC_Sem_0803_ModuleControlPart_001_second(verdicttype p_passthroughVerdict) runs on GeneralComp { + if (match(p_passthroughVerdict, getverdict) and match(getverdict, none) ) { // verdict should be none. + setverdict(fail); + } else { + setverdict(pass); + } +} + + +control { + var verdicttype v_myverdict; + v_myverdict := execute(TC_Sem_0803_ModuleControlPart_001()); + execute(TC_Sem_0803_ModuleControlPart_001_second(v_myverdict)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_001.ttcn b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76c83aa43f5c3e9a750d96be9152e78f773ea15e --- /dev/null +++ b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_001.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.3, Ensure that the module control is able to accept execute statements. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0803_ModuleControlPart_001 { + +type component GeneralComp {} + +testcase TC_Syn_0803_ModuleControlPart_001() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_Syn_0803_ModuleControlPart_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_002.ttcn b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7cfc2ca66015b15ae93f5cb7eb1a62ab68ffdff3 --- /dev/null +++ b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.3, Ensure that the module control part with a few commonly used stateents is accepted. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Syn_0803_ModuleControlPart_002 { + +type component GeneralComp {} + +type record MyRecordType { + integer field1, + charstring field2 +} + +testcase TC_Syn_0803_ModuleControlPart_002() runs on GeneralComp { + setverdict(pass); +} + +control { + var integer v_i := 1; + const charstring v_hello := "Hello World"; + timer t_mytimer; + t_mytimer.start(1.0); + if (v_i == 1) { + execute(TC_Syn_0803_ModuleControlPart_002(), 5.0); + } else { + log("something went wrong"); + } + t_mytimer.stop; +} + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_003.ttcn b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83000c026664ab3fe5c027a2e42798ab1f503622 --- /dev/null +++ b/ATS/core_language/08_modules/0803_module_control_part/Syn_0803_ModuleControlPart_003.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:8.3, Ensure that an empty control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_0803_ModuleControlPart_003 { + +control { + +} + +} \ No newline at end of file diff --git a/ATS/core_language/08_modules/NOTES b/ATS/core_language/08_modules/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..1658e9e623da42a845885fd84e872a8948e53c76 --- /dev/null +++ b/ATS/core_language/08_modules/NOTES @@ -0,0 +1 @@ +- TODO: add more tests. Pretty basic currently. \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_001.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75ab8ef779e96a27e04a359b12f4a728a2ed43b1 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_001.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Ensure that a port owned by a component cannot be connected with two other ports + ** @verdict pass reject + ** @configuration port:broadcast + ***************************************************/ + +/*NOTE: see Figure 7(c): Two components (A and B with two ports). + * ERROR: Port A connects to port B1 and port B2, this is not allowed + * */ + +module NegSem_0901_Communication_ports_001{ + + + type component GeneralComp{ + port IntegerInputPortType messagePortA,messagePortB; + }; + + type port IntegerInputPortType message { + inout integer + } + + + +testcase TC_NegSem_0901_Communication_ports_001() runs on GeneralComp system GeneralComp { + +// generate test components + var GeneralComp MycompA; + var GeneralComp MycompB; + MycompA := GeneralComp.create; + MycompB := GeneralComp.create; + +// make the connections between ports + connect(MycompA:messagePortA,MycompB:messagePortA); + connect(MycompA:messagePortA,MycompB:messagePortB); //Error: not allowed, MycompA messagePortA is already connected to MycompB messagePortA +} +control{ + execute(TC_NegSem_0901_Communication_ports_001()); +} +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_002.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a39bc556dd3ee11d054d241296e3dc07ac35ae30 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that it is not possible to connect a mapped port + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(f): connection of two TSI ports is not allowed + * */ + +module NegSem_0901_Communication_ports_002{ + + + type port loopbackPort message { + inout integer + } + type port MyPort message { + inout integer + } + +type component GeneralComp { + port loopbackPort messagePort; + port MyPort messagePortB; + +} + +testcase TC_NegSem_0901_Communication_ports_002() runs on GeneralComp { + +connect(mtc:messagePort,mtc:messagePortB); // not allowed + +} + +control{ + execute(TC_NegSem_0901_Communication_ports_002()); +} + +} diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_003.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ff8f803a6f77259c005d342904a4d79daaed07a --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that it is not possible to connect a port with two other ports owned by the same component + ** @verdict pass reject + ** @configuration port:broadcast + ***************************************************/ + +/*NOTE: see Figure 7(a): MyCompA has 3 ports and A2 shall not be connected to A1 and A3 both + * */ + +module NegSem_0901_Communication_ports_003{ + + type charstring address; + type port IntegerInputPortType message { + inout integer + } + +type component MycompA { // MyCompA has 3 ports + port IntegerInputPortType messagePortA1,messagePortA2,messagePortA3 +} + +testcase TC_NegSem_0901_Communication_ports_003() runs on MycompA { + +connect(mtc:messagePortA1,mtc:messagePortA2); +connect(mtc:messagePortA2,mtc:messagePortA3); // Error: this is not allowed + } + +control{ + execute(TC_NegSem_0901_Communication_ports_003()); +} + +} diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_004.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed4692a8de658da25287480859ffae8424ccd25f --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_004.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that it is not possible to map a connected port + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(b): GeneralComp port p1 is mapped to a TSI port P1. + * Therefore mapping GeneralComp port p2 with TSI port P1 gives an error. + * */ + + + +module NegSem_0901_Communication_ports_004 { + + type port MyPort message { + inout integer + } + + type component GeneralComp + { + port MyPort p1; + port MyPort p2; + } + + type component SystemComp + { + port MyPort p1; + } + + testcase TC_NegSem_0901_Communication_ports_004() runs on GeneralComp system SystemComp { + +//create a test component + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + map(self:p1, system:p1); // error: v_ptc.p1 is already mapped to SystemComp.p1 + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_004()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_005.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39e9920401a9f9fd4646bcc8c80bde8a8e00c127 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_005.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that it is not possible to connect a port with a port owned by the same component + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(e): GeneralComp have two ports (p1 and p2). + * ERROR: Port p1 is connected to p1 (self), therefore connection between p1 and p2 gives an error + * */ + + +module NegSem_0901_Communication_ports_005 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + testcase TC_NegSem_0901_Communication_ports_005() runs on GeneralComp system GeneralComp { + + connect(self:p1, self:p1); + connect(self:p1, self:p2); // error expected here, since p1 is already connected to p1. + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_005()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_006.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9fcb6e5200c307ace1ed4fe769797beed89a8dbf --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_006.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that only 1:1 connection between component port and TSI are allowed + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(d): MyCompA has a port (p1). + * ERROR: TSI have two ports p1 and p2. GeneralComp port S1 can not be connected to both p1 and p2. + * */ + +module NegSem_0901_Communication_ports_006 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P S1; + } + + type component MyComp + { + port P p1, p2; + } + + testcase TC_NegSem_0901_Communication_ports_006() runs on GeneralComp system GeneralComp { + +// Creating test component: + var MyComp MycompA; + MycompA := MyComp.create; + +// make the connections between ports: + connect(self:S1,MycompA:p1); + connect(self:S1,MycompA:p2); //not allowed, since p1 is already connected to S1 + + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_006()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_007.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fda45eb76191326761992b7979341bec07da2aac --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a two TSI port cannot be connected + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(f): Two TSI port cannot be connected + * */ + +module NegSem_0901_Communication_ports_007 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + testcase TC_NegSem_0901_Communication_ports_007() runs on GeneralComp system GeneralComp { + var GeneralComp s := system; + map(s:p2, system:p1); // error: p1 and p2 cannot be connected + + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_007()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b14806fdb7535fac6c5a048427ec0213b2b32caf --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_008.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that mapping an already connected port is not allowed + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(g): Two components (A and B). MycompA:p1 is connected to MycompB:p1. + * Therefore mapping MycompB to TSI port p1 is not allowed + * */ + +module NegSem_0901_Communication_ports_008 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1; + } + + testcase TC_NegSem_0901_Communication_ports_008() runs on GeneralComp system GeneralComp { + + // generate test components + var GeneralComp MycompA; + var GeneralComp MycompB; + MycompA := GeneralComp.create; + MycompB := GeneralComp.create; + + connect(MycompA:p1,MycompB:p1); + map(MycompB:p1,system:p1); // not allowed, since MyCompB:p1 is already connected to MyCompA:p1 + + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_008()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_009.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57782ef4050a6091f2def312b896f760d98b3f0b --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_009.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that connections within the test system interface are not allowed + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction a): Connections within the test system interface are not allowed. + +module NegSem_0901_Communication_ports_008 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + testcase TC_NegSem_0901_Communication_ports_008() runs on GeneralComp system GeneralComp { + map(system:p1, system:p1); // mapping system port to itself: error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_008()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_010.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72cd4eade11a34ccbef4f775f04ae9b627e637fd --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/NegSem_0901_Communication_ports_010.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a two TSI port cannot be connected + ** @verdict pass reject + ***************************************************/ + +/*NOTE: see Figure 7(f): Two TSI port cannot be connected + * */ + +module NegSem_0901_Communication_ports_010 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + type component General_System_Comp + { + port P p_system_1, p_system_2; + } + + testcase TC_NegSem_0901_Communication_ports_010() runs on GeneralComp system General_System_Comp { + + + connect(system:p_system_1, system:p_system_2); // error: p_system_1 and p_system_2 cannot be connected + + setverdict(pass); + } + + control{ + execute(TC_NegSem_0901_Communication_ports_010()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_001.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2e2825c03b2c0918cdb2580c9793122418cbd35 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_001.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the IUT correctly handles loopback message + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Loopback test: messagePort is a loopback port and sends (2). If receives(2) pass, else failed. +module Sem_0901_Communication_ports_001{ + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_0901_Communication_ports_001() runs on GeneralComp { + + + messagePort.send(2); //can send also in-line template + + alt { + [] messagePort.receive(2) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_0901_Communication_ports_001()); +} + +} diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_002.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6d6783c046fedbff9692e01171007a07d4393f9 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompA + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration port:broadcast + ***************************************************/ + +// Two component mycompA and B message exchange +module Sem_0901_Communication_ports_002{ + + type port myport message { + inout integer + } + + +type component Mysystem + { + timer t_rec,t_rec2; + port myport messagePort; + } +function fsend() runs on Mysystem { +messagePort.send(2); + t_rec2.start(20.0); + alt { + [] messagePort.receive(3) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + [] t_rec2.timeout { + setverdict( inconc ); + } + } +t_rec2.stop; +} +function frec() runs on Mysystem { + t_rec.start( 20.0 ); + alt { + [] messagePort.receive(2) { + messagePort.send(3); + setverdict( pass ); + } + [] messagePort.receive { + setverdict( fail ); + } + [] t_rec.timeout { + setverdict( inconc ); + } + } +t_rec.stop; +} + +testcase TC_Sem_0901_Communication_ports_002() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + var Mysystem MyCompB; + +MyCompA:=Mysystem.create; +MyCompB:=Mysystem.create; +connect(MyCompA:messagePort,MyCompB:messagePort); +connect(MyCompB:messagePort,MyCompA:messagePort); + + +MyCompB.start(frec()); +MyCompA.start(fsend()); + +//MyCompB.stop; +//MyCompA.stop; + + MyCompB.done; + MyCompA.done; + +} +control{ + execute(TC_Sem_0901_Communication_ports_002()); +} +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_003.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98f207fc11447cceff606a3fd410d130523cf3e0 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_003.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompB and mycompC + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration port:broadcast + ***************************************************/ + +// 3 component message exchange +module Sem_0901_Communication_ports_003{ + + type port myport message { + inout integer + } + + +type component Mysystem + { + timer t_rec,t_rec2; + port myport messagePort; + } +function fsend() runs on Mysystem { + messagePort.send(2) to all component; + t_rec2.start(30.0); + alt { + [] messagePort.receive(3) { + setverdict(pass); + t_rec2.stop; + } + [] messagePort.receive { + setverdict(fail); + } + [] t_rec2.timeout { + setverdict( inconc ); + } + } +t_rec2.stop; +} +function frec() runs on Mysystem { + t_rec.start( 10.0 ); + alt { + [] messagePort.receive(2) { + messagePort.send(3); + setverdict( pass ); + } + [] messagePort.receive { + setverdict( fail ); + } + [] t_rec.timeout { + setverdict( inconc ); + } + } +t_rec.stop; +} + +testcase TC_Sem_0901_Communication_ports_003() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + var Mysystem MyCompB; + var Mysystem MyCompC; + +MyCompA:=Mysystem.create; +MyCompB:=Mysystem.create; +MyCompC:=Mysystem.create; +connect(MyCompA:messagePort,MyCompB:messagePort); +connect(MyCompB:messagePort,MyCompA:messagePort); +connect(MyCompA:messagePort,MyCompC:messagePort); +connect(MyCompC:messagePort,MyCompA:messagePort); + + +MyCompB.start(frec()); +MyCompC.start(frec()); +MyCompA.start(fsend()); + +/* alt { + [] messagePort.receive(3) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + }*/ + +// wait until all components finish +MyCompB.done; +MyCompC.done; +MyCompA.done; + +MyCompB.stop; +MyCompC.stop; +MyCompA.stop; + +} +control{ + execute(TC_Sem_0901_Communication_ports_003()); +} +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_004.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87f9e036fe456b607ffeb10c9d74b74041928631 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the IUT correctly handles message exch. between ports + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration port:broadcast + ***************************************************/ + +// GeneralComp has two ports. mess.portA sends a message to messageportB. +module Sem_0901_Communication_ports_004{ + + + type port IntegerPortType message { + inout integer + } + + +type component GeneralComp { + port IntegerPortType messagePortA,messagePortB +} + +testcase TC_Sem_0901_Communication_ports_004() runs on GeneralComp { + + + messagePortA.send(2); //can send also in-line template + + alt { + [] messagePortB.receive(2) { + setverdict(pass); + } + [] messagePortB.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_0901_Communication_ports_004()); +} + +} diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_005.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8fa6aa0dc4329bad0ce2ccb2143f8a5e7f60f51f --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_005.ttcn @@ -0,0 +1,100 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the the IUT receives the message sent by mycompA + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration port:broadcast + ***************************************************/ + +//Mycomp A has two ports and MycompB has two ports. +module Sem_0901_Communication_ports_005{ + + type port myport message { + inout integer + } + + +type component Mysystem + { + timer t_rec,t_rec2; + port myport messagePort1,messagePort2; + } +function fsend() runs on Mysystem { +messagePort1.send(1); +messagePort2.send(2); + t_rec2.start(20.0); + alt { + [] messagePort1.receive(3) { + setverdict(pass); + } + [] messagePort1.receive { + setverdict(fail); + } + [] t_rec2.timeout { + setverdict( inconc ); + } + } + alt { + [] messagePort2.receive(4) { + setverdict(pass); + } + [] messagePort2.receive { + setverdict(fail); + } + [] t_rec2.timeout { + setverdict( inconc ); + } + } +t_rec2.stop; +} +function frec() runs on Mysystem { + t_rec.start( 20.0 ); + alt { + [] messagePort1.receive(1) { + messagePort1.send(3); + setverdict( pass ); + } + [] messagePort1.receive { + setverdict( fail ); + } + [] t_rec.timeout { + setverdict( inconc ); + } + } + alt { + [] messagePort2.receive(2) { + messagePort2.send(4); + setverdict( pass ); + } + [] messagePort2.receive { + setverdict( fail ); + } + [] t_rec.timeout { + setverdict( inconc ); + } + } +t_rec.stop; +} + +testcase TC_Sem_0901_Communication_ports_005() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + var Mysystem MyCompB; + +MyCompA:=Mysystem.create; +MyCompB:=Mysystem.create; +connect(MyCompA:messagePort1,MyCompB:messagePort1); +connect(MyCompB:messagePort2,MyCompA:messagePort2); + + +MyCompB.start(frec()); +MyCompA.start(fsend()); + +// MyCompB.stop; +// MyCompA.stop; +MyCompB.done; +MyCompA.done; +} +control{ + execute(TC_Sem_0901_Communication_ports_005()); +} +} diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_006.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d9a3b652a82ced119b0f2138f31ccc3ffdf4268 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_006.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a port can connect to itself + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Figure 6: Allowed connections, connection scheme e) + +module Sem_0901_Communication_ports_006 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_0901_Communication_ports_006() runs on GeneralComp system GeneralComp { + connect(self:p, self:p); + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_0901_Communication_ports_006()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_007.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..026b6eff52a9f37c8805e1d43d3db1a59a5eaf1c --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_007.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a port can connect to another port of the same component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Figure 6: Allowed connections, connection scheme f) + +module Sem_0901_Communication_ports_007 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + testcase TC_Sem_0901_Communication_ports_007() runs on GeneralComp system GeneralComp { + connect(self:p1, self:p2); + if(p1.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_0901_Communication_ports_007()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_008.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6aed9f85e45bd7d1fe6e89817628437fa531a46b --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_008.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that more than one component port can mapped to a single system port + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Figure 6: Allowed connections, connection scheme h) + +module Sem_0901_Communication_ports_008 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkMapped() runs on GeneralComp + { + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_0901_Communication_ports_007() runs on GeneralComp system GeneralComp { + // components are created alive so that their mappings are not destroyed when behaviour stops + var GeneralComp v_ptc1 := GeneralComp.create alive, + v_ptc2 := GeneralComp.create alive; + map(self:p, system:p); + map(v_ptc1:p, system:p); + map(v_ptc2:p, system:p); + v_ptc1.start(checkMapped()); + v_ptc2.start(checkMapped()); + checkMapped(); + all component.done; + } + + control{ + execute(TC_Sem_0901_Communication_ports_007()); + } +} + diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a4668a0f26d2c2b5e58092703e98c44c7b489ca --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_009.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a component port can be connected to two other component ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/*NOTE: figure 6(g): A component port can be connected to two other component ports */ + +module Sem_0901_Communication_ports_009 { + + type port MyPort message { + inout integer + } + + type component GeneralComp + { + port MyPort p; + } + + function checkConnected() runs on GeneralComp + { + if(p.checkstate("Connected")) { + setverdict(pass,"Connected"); + } else { + setverdict(fail,"Not Connected"); + } + } + + testcase TC_Sem_0901_Communication_ports_009() runs on GeneralComp system GeneralComp { + +//creating 3 components: + var GeneralComp v_ptcA := GeneralComp.create; + var GeneralComp v_ptcB := GeneralComp.create; + var GeneralComp v_ptcC := GeneralComp.create; + + + connect(v_ptcA:p, v_ptcB:p); + connect(v_ptcA:p, v_ptcC:p); + + v_ptcB.start(checkConnected()); + v_ptcC.start(checkConnected()); + + } + + control{ + execute(TC_Sem_0901_Communication_ports_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d46e01a4f96b059afa1707dc3ff0029cc43482f4 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_010.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a component port can be mapped to TSI port + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* NOTE: figure 6(b): Ensure that a component port can be mapped to a TSI port */ + +module Sem_0901_Communication_ports_010 { + + type port MyPort message { + inout integer + } + + type component GeneralComp + { + port MyPort p; + } + + type component MyCompA + { + port MyPort p; + } + + function checkMapped() runs on MyCompA + { + if(p.checkstate("Mapped")) { + setverdict(pass,"Mapped"); + } else { + setverdict(fail,"Not Mapped"); + } + } + + testcase TC_Sem_0901_Communication_ports_010() runs on MyCompA system GeneralComp { + + map(self:p,system:p); + checkMapped(); + } + + control{ + execute(TC_Sem_0901_Communication_ports_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67a89dbdf71480c2c1672f82b5f3c8aaf6ef0873 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0901_communication_ports/Sem_0901_Communication_ports_011.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 478 + ** @version 0.0.1 + ** @purpose 1:9.1, Verify that a component ports can be mapped to TSI ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* NOTE: figure 6(d): Ensure that component ports can be mapped to a TSI ports */ + +module Sem_0901_Communication_ports_011 { + + type port MyPort message { + inout integer + } + + type component GeneralComp + { + port MyPort p1,p2; + } + + type component MyComp + { + port MyPort p1,p2; + } + function checkMapped() runs on MyComp + { + if(p1.checkstate("Mapped") and p2.checkstate("Mapped")) { + setverdict(pass,"Mapped"); + } else { + setverdict(fail,"Mapped"); + } + } + + testcase TC_Sem_0901_Communication_ports_011() runs on MyComp system GeneralComp { + + map(self:p1, system:p1); + map(self:p2, system:p2); + + checkMapped(); + } + + control{ + execute(TC_Sem_0901_Communication_ports_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_001.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c81983e965132f204e5b77d868a9b1856668288 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the IUT correctly handles the assoc. of two port to the same system interface + ** @verdict pass reject + ***************************************************/ +//Two comp. ports are connected to the same system interface port (not allowed). +module NegSem_0902_Communication_ports_001{ + + type port loopbackPort message { + inout integer + } + + type port MyMessagePortType message { + inout integer + } + + +type component GeneralComp + { + port MyMessagePortType MycomportA, MycomportB + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } +// MyTestSystemInterface is the test system interface +testcase TC_NegSem_0902_Communication_ports_001() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:MycomportA, system:messagePort); +map(mtc:MycomportB, system:messagePort); // not allowed + +} +control{ + execute(TC_NegSem_0902_Communication_ports_001()); +} +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_002.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1bc3ed91773e429ef92bf339d7606b9d40b5e61 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the mycomp is connected to two system interface port. + ** @verdict pass reject + ***************************************************/ + +//It is not allowed to connect one port connect to two system interface port. +module NegSem_0902_Communication_ports_002{ + + type port loopbackPort message { + inout integer + } + type port MyMessagePortType message { + inout integer + } + +type component GeneralComp + { + port MyMessagePortType Mycomport + } + +type component MyTestSystemInterface + { + port loopbackPort messagePortA,messagePortB + } +// MyTestSystemInterface is the test system interface +testcase TC_NegSem_0902_Communication_ports_002() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:Mycomport, system:messagePortA); +map(mtc:Mycomport, system:messagePortB); // not allowed + +setverdict(fail); + +} +control{ + execute(TC_NegSem_0902_Communication_ports_002()); +} +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_003.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3b53373791b5c54ad313a4115398a34392cf56a --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the two system interf. port cannot connect + ** @verdict pass reject + ***************************************************/ + +//Two system interface ports are not allowed to connect +module NegSem_0902_Communication_ports_003{ + + type port loopbackPort message { + inout integer + } +type component MyTestSystemInterface + { + port loopbackPort messagePortA,messagePortB + } +// MyTestSystemInterface is the test system interface + +testcase TC_NegSem_0902_Communication_ports_003() runs on MyTestSystemInterface { +// establishing the port connections +map(system:messagePortA, system:messagePortB); // not allowed + +setverdict(fail); + +} +control{ + execute(TC_NegSem_0902_Communication_ports_003()); +} +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_004.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..495208ed7a3c28647edcb15e9ed322ff793cd810 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/NegSem_0902_Communication_ports_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the a connected port cannot be mapped + ** @verdict pass reject + ***************************************************/ + +// A connected port cannot be mapped with a system interface port +module NegSem_0902_Communication_ports_004{ + + type port loopbackPort message { + inout integer + } +type port IntegerOutputPortType message { + inout integer + } + + +type component MyTestSystemInterface + { + port IntegerOutputPortType messagePort + } +// MyTestSystemInterface is the test system interface +testcase TC_NegSem_0902_Communication_ports_004() runs on MyTestSystemInterface system MyTestSystemInterface { +// establishing the port connections + var MyTestSystemInterface MycompA; + var MyTestSystemInterface MycompB; +MycompA := MyTestSystemInterface.create; +MycompB := MyTestSystemInterface.create; + +connect(MycompA:messagePort,MycompB:messagePort); +map(MycompB:messagePort, system:messagePort); // not allowed this type of connection + +} +control{ + execute(TC_NegSem_0902_Communication_ports_004()); +} +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_001.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a3db5b4c74cd4bda601bcdb1a81568d24e424e8 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_001.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the IUT port correctly mapped with a system interface + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Mycompport A is mapped with a system interface +module Sem_0902_Communication_ports_001{ + + type port loopbackPort message { + inout integer + } +type port IntegerOutputPortType message { + inout integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } +// MyTestSystemInterface is the test system interface +testcase TC_Sem_0902_Communication_ports_001() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:MycomportA, system:messagePort); + + + MycomportA.send(2); //can send also in-line template + + alt { + [] MycomportA.receive(2) { + setverdict(pass); + } + [] MycomportA.receive { + setverdict(fail); + } + } +} +control{ + execute(TC_Sem_0902_Communication_ports_001()); +} +} \ No newline at end of file diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_002.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6f48d95263130fc3759670cad4b98a2edef0883 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/Sem_0902_Communication_ports_002.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that the IUTs two ports are mapped correctly to system interfaces + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Two ports are mapped to two system interface +module Sem_0902_Communication_ports_002{ + + type port loopbackPort message { + inout integer + } + type port MyMessagePortType message { + inout integer + } + +type component GeneralComp +{ +var integer v_received1:=0; +var integer v_received2:=0; +port MyMessagePortType myPortA,myPortB +} + +type component MyTestSystemInterface + { + port loopbackPort messagePortA,messagePortB + } + +// MyTestSystemInterface is the test system interface +testcase TC_Sem_0902_Communication_ports_002() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:myPortA, system:messagePortA); +map(mtc:myPortB, system:messagePortB); + + + myPortA.send(2); //can send also in-line template + myPortB.send(3); + + myPortA.receive(integer:?) -> value v_received1 ; + myPortB.receive(integer:?) -> value v_received2 ; + + if ((v_received1+v_received2)==5) + { + setverdict(pass); + } + else + { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_0902_Communication_ports_002()); +} + +} diff --git a/ATS/core_language/09_test_configurations/0902_test_system_interface/Syn_0902_Communication_ports_001.ttcn b/ATS/core_language/09_test_configurations/0902_test_system_interface/Syn_0902_Communication_ports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e2c440da7068f1a2fcec717aed30952fb6de5c6 --- /dev/null +++ b/ATS/core_language/09_test_configurations/0902_test_system_interface/Syn_0902_Communication_ports_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:9, Ensure that two component can be mapped by one system interface +** @verdict pass accept, noexecution + ***************************************************/ + //Two components are mapped to the same system interface +module Syn_0902_Communication_ports_001{ + + type port myPort message { + inout integer + } + + +type component MyTestSystemInterface + { + port myPort messagePort; + } + +// MyTestSystemInterface is the test system interface +testcase TC_Syn_0902_Communication_ports_001() runs on MyTestSystemInterface system MyTestSystemInterface { +// establishing the port connections + var MyTestSystemInterface MycompA; + var MyTestSystemInterface MycompB; +MycompA := MyTestSystemInterface.create; +MycompB := MyTestSystemInterface.create; + +map(MycompA:messagePort, system:messagePort); +map(MycompB:messagePort, system:messagePort); + +} +control{ + execute(TC_Syn_0902_Communication_ports_001()); +} +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/NOTES b/ATS/core_language/10_constants/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..e293a841bec3a027fe29ebc08d48a1d53c63ec94 --- /dev/null +++ b/ATS/core_language/10_constants/NOTES @@ -0,0 +1,3 @@ +- TODO: missing test for init with functions +- TODO: missing test for init with expressions +- TODO: missing test for init structured types with optional fields diff --git a/ATS/core_language/10_constants/NegSem_10_Constants_001.ttcn b/ATS/core_language/10_constants/NegSem_10_Constants_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..327fbc87f3ed0ecf73b20b00fc8053cf556a896d --- /dev/null +++ b/ATS/core_language/10_constants/NegSem_10_Constants_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Assign rnd to constant used in type, not allowed since constant expressions used in types have to be known at compile-time. + ** @verdict pass reject + ***************************************************/ +module NegSem_10_Constants_001 { + + const float c_i := rnd(314E-2); // not allowed by standard + type float MyFloat (c_i); + + type component GeneralComp {} + + testcase TC_NegSem_10_Constants_001() runs on GeneralComp { + var MyFloat v_f := c_i; + log(v_f); + setverdict(pass); + } + + control{ + execute(TC_NegSem_10_Constants_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/NegSem_10_Constants_002.ttcn b/ATS/core_language/10_constants/NegSem_10_Constants_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79a20dbfa644836ef9b86c917b3b2a470772a7c2 --- /dev/null +++ b/ATS/core_language/10_constants/NegSem_10_Constants_002.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, A value is assigned only once to a constant + ** @verdict pass reject + ***************************************************/ +module NegSem_10_Constants_002 { + + const float c_i := 3.14; + + + type component GeneralComp {} + + testcase TC_NegSem_10_Constants_002() runs on GeneralComp { + c_i := 3.15; //error because value is assigned only once to the constant + } + + control{ + execute(TC_NegSem_10_Constants_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/NegSem_10_Constants_003.ttcn b/ATS/core_language/10_constants/NegSem_10_Constants_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..769e1bc076907867992c356f03d5765354d393f5 --- /dev/null +++ b/ATS/core_language/10_constants/NegSem_10_Constants_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Constant shall not be of port type + ** @verdict pass reject + ***************************************************/ +module NegSem_10_Constants_003 { + + //only for negSyn constant shall not be of port type + type port MyMessagePortType message + { + inout integer + } + + + type component GeneralComp { + } + + testcase TC_NegSem_10_Constants_003() runs on GeneralComp { + const MyMessagePortType c_port:= 5;//error - constant shall not be of port type + }//end testcase + + control{ + execute(TC_NegSem_10_Constants_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/NegSem_10_Constants_004.ttcn b/ATS/core_language/10_constants/NegSem_10_Constants_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ecc74edcd89bc2302daf1b508aec05eac160364 --- /dev/null +++ b/ATS/core_language/10_constants/NegSem_10_Constants_004.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:10, Ensure that dot notation of a field in a record, which actual value is null shall cause an error + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: +Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + +module NegSem_10_Constants_004 { + + type integer address; + type record MyRecordType + { + address field1, + integer field2 optional + }; + + type component GeneralComp { + } + + testcase TC_NegSem_10_Constants_004() runs on GeneralComp { + + var MyRecordType R1:= {field1 := null, + field2 := 2}; + + const integer C1 := R1.field1; //error + + if (match(C1, R1.field1)) { setverdict(pass,"match") } + else { setverdict(fail) } + } + + control{ + execute(TC_NegSem_10_Constants_004()); + } +} diff --git a/ATS/core_language/10_constants/NegSem_10_Constants_005.ttcn b/ATS/core_language/10_constants/NegSem_10_Constants_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..895791b1606b595a22e63061ee890bdf6a95de1c --- /dev/null +++ b/ATS/core_language/10_constants/NegSem_10_Constants_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:10, Ensure that index notation of a field in a set of type, which actual value is null shall cause an error + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: +Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + +module NegSem_10_Constants_005 { + + type integer address; + type default MyDef; + type set of address MySetofInt; + + type component GeneralComp { + } + + testcase TC_NegSem_10_Constants_005() runs on GeneralComp { + + var MySetofInt R1:= {[0] := null}; + var MyDef R2:= null; + + const default C2 := R2; //allowed + const integer C1 := R1[0]; //error + + if (match(C1,R1[0])) { setverdict(pass,"match") } + else { setverdict(fail) } + } + + control{ + execute(TC_NegSem_10_Constants_005()); + } +} diff --git a/ATS/core_language/10_constants/Sem_10_Constants_001.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd47b266f7374ab616d73a80f38af221f46d9679 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_001.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Assign and read constants + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_001 { + + const integer c_i := 5; + + type component GeneralComp {} + + testcase TC_Sem_10_Constants_001() runs on GeneralComp { + const integer c_j := 5; + + if (c_i == c_j){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_002.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dcfc3d764b3805ed09a1f18b48f43be07f8dc0c5 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_002.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Assign and read constants values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_002 { + + const integer c_ai[3] := {1, 3, 5}; + + type component GeneralComp {} + + testcase TC_Sem_10_Constants_002() runs on GeneralComp { + const integer c_j := 5; + + if (c_ai[2] == c_j){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_003.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01c330f88a678d0789bafc02daf55641a6b321f4 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Single expression and constant values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_003 { + + const float c_p :=3.0; + const float c_i :=0.14; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_003() runs on GeneralComp { + + const float c_pi := (c_p+c_i); + + if (c_pi == 3.14){ + setverdict(pass); + } + else { + setverdict(fail); + } + }//end testcase + + control{ + execute(TC_Sem_10_Constants_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_004.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80734c92eef394d9cfaa815c82119343de86f8d1 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Constant used within invoke function with return + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_004 { + + type component GeneralComp { + } + //2 + function f_Sem_10_Constants_004(integer p_int) runs on GeneralComp return integer{ + const integer c_i := 2; + if(p_int==0) + { + return c_i; + } + else + { + return 0; + } + } + + testcase TC_Sem_10_Constants_004() runs on GeneralComp { + const integer c_int := 2; + if (f_Sem_10_Constants_004(0)==c_int) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } //end testcase + + control{ + execute(TC_Sem_10_Constants_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_005.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f37aad39f4e8d082863572eb18f32a599e59bbb --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Constant used within predefined function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_005 { + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_005() runs on GeneralComp { + + const integer c_j := 5; + const charstring c_str_j := int2str(c_j); + + if (c_str_j=="5"){ + setverdict(pass); + } + else { + setverdict(fail); + } + }//end testcase + + control{ + execute(TC_Sem_10_Constants_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_006.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98a325da97c505cc916271d0a3097ed70388535a --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Record type used as a constant + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_006 { + + type record MyRecordType + { + bitstring field1, + boolean field2, + charstring field3 + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_006() runs on GeneralComp { + const MyRecordType c_mRT1 := {'1010'B,true,"string"}; + const MyRecordType c_mRT2 := {field1 := '1010'B, + field2 := true, + field3 := "string"}; + + if (c_mRT1==c_mRT2) + { + setverdict(pass); + } + else { + setverdict(fail); + } + }// end testcase + + control{ + execute(TC_Sem_10_Constants_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_007.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef4accae65aad8d4c6c7acbf28f237914b77cfb3 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_007.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Record type used as a constant with optional fields + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_007 { + + type record MyRecordType + { + bitstring field1, + boolean field2 optional, + charstring field3 optional + + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_007() runs on GeneralComp { + const MyRecordType c_mRT3 := {field1 := '1010'B, + field2 := -, + field3 := -}; + + if (not isbound(c_mRT3.field2) and + not isbound(c_mRT3.field3) and + match(c_mRT3.field1, '1010'B)) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_008.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..297dba392415abf8b6aff6edf3a50534fa00fd0c --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Set type used as a constant + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_008 { + + type set MySetType + { + bitstring field1, + boolean field2, + charstring field3 + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_008() runs on GeneralComp { + const MySetType c_mST1 := {'1010'B,true,"string"}; + const MySetType c_mST2 := {field1 := '1010'B, + field2 := true, + field3 := "string"}; + + if (c_mST1==c_mST2) + { + setverdict(pass); + } + else { + setverdict(fail); + } + }// end testcase + + control{ + execute(TC_Sem_10_Constants_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Sem_10_Constants_009.ttcn b/ATS/core_language/10_constants/Sem_10_Constants_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d741f7c964460669f5c868a20e02b1741056dd24 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_Constants_009.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:10, Set type used as a constant with optional fields + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_10_Constants_009 { + + type record MySetType + { + bitstring field1, + boolean field2 optional, + charstring field3 optional + + }; + + type component GeneralComp { + } + + testcase TC_Sem_10_Constants_009() runs on GeneralComp { + const MySetType c_mST3 := {field1 := '1010'B, + field2 := -, + field3 := -}; + + if (not isbound(c_mST3.field2) and + not isbound(c_mST3.field3) and + match(c_mST3.field1, '1010'B)) + { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_10_Constants_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Syn_10_Constants_001.ttcn b/ATS/core_language/10_constants/Syn_10_Constants_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd9acae1719259d96d8f4fadbd1c4804add15374 --- /dev/null +++ b/ATS/core_language/10_constants/Syn_10_Constants_001.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Create constants + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_10_Constants_001 { + const integer c_i1 := 5, c_i2 := 3; + const float c_f := 3.14E-4; + const boolean c_b := true, c_b2 := false; + const bitstring c_bs := '1011'B; +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Syn_10_Constants_002.ttcn b/ATS/core_language/10_constants/Syn_10_Constants_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf62e4f631d41de3d8195f37d7ef19935d1a849b --- /dev/null +++ b/ATS/core_language/10_constants/Syn_10_Constants_002.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Assign default constants values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_10_Constants_002 { + const default c_d := null; +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Syn_10_Constants_003.ttcn b/ATS/core_language/10_constants/Syn_10_Constants_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f12665f648604da8942e640b999b20f6fa30ac8a --- /dev/null +++ b/ATS/core_language/10_constants/Syn_10_Constants_003.ttcn @@ -0,0 +1,11 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Assign component constants values + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_10_Constants_003 { + type component GeneralComp {} + + const GeneralComp c_c := null; +} \ No newline at end of file diff --git a/ATS/core_language/10_constants/Syn_10_Constants_004.ttcn b/ATS/core_language/10_constants/Syn_10_Constants_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05eac7e906b4f5f856a3f4e57f0ed88ef4c64652 --- /dev/null +++ b/ATS/core_language/10_constants/Syn_10_Constants_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:10, Define constants in different scopes + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_10_Constants_004 { + type component GeneralComp { + timer t; + const integer cv_i1 := 10; + } + + const integer c_i1 := 5; + + altstep a_Syn_10_Constants_004() runs on GeneralComp { + const integer cl_j := 12; + [] t.timeout { + const integer cl_k := 13; + } + } + + function f_Syn_10_Constants_004() runs on GeneralComp { + const integer cl_i := 2; + } + + testcase TC_Syn_10_Constants_004() runs on GeneralComp { + const integer cl_i := 3; + } + + control { + const integer cl_i := 1; + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/NOTES b/ATS/core_language/11_variables/1101_value_variables/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..d88dd44060bb60992adf062e0c7da46dbc5dfd48 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NOTES @@ -0,0 +1,4 @@ +- TODO: other types as integer are used +- TODO: init with functions +- TODO: init with expressions +- TODO: init structured types with optional fields diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_001.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8445484a00a84c61f6dec9d85dbdf5a5e288b0b3 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_001.ttcn @@ -0,0 +1,18 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Variables should be assigned only by values + ** @verdict pass reject + ***************************************************/ +module NegSem_1101_ValueVars_001 { + type component GeneralComp {} + + testcase TC_NegSem_1101_ValueVars_001() runs on GeneralComp { + var integer v_i := ?; // ? is not a value + setverdict(pass); + } + + control { + execute(TC_NegSem_1101_ValueVars_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_002.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a0c9f766c15d4885b476c09f9fb5248f7bc23ff3 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that partially initialized variables are evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1101_ValueVars_002 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_NegSem_1101_ValueVars_002() runs on GeneralComp { + var IntegerSet v_set := {a1:=1,a2:=omit}; + + if ( v_set == {a1:=1,a2:=omit,a3:=3} ) { //attempted use of partially initialized variable + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1101_ValueVars_002()); +} + +} diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db3dae919082bc8cea8d70a79f1e2b01c1599951 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_003.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that dot notation referencing to a field, which actual value is null shall cause an error. + ** @verdict pass reject + *****************************************************************/ + +/* The following requirements are tested: +Restriction h. : Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + +module NegSem_1101_ValueVars_003 { + +type component GeneralComp { +} + + type integer address; + type record MyRecordType + { + address field1, + integer field2 optional + }; + + +testcase TC_NegSem_1101_ValueVars_003() runs on GeneralComp { + var MyRecordType R1:= {field1 := null, + field2 := -}; + + var integer Myvar := R1.field1; //error + + if (match(Myvar, R1.field1)) { setverdict(pass,"match") } + else { setverdict(fail) } + } + + +control{ + execute(TC_NegSem_1101_ValueVars_003()); +} + +} diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82ea722a042db1a2cf636c4bfddeeaebb09d7d19 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_004.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that index notation referencing to a "set of", which actual value is null shall cause an error. + ** @verdict pass reject + *****************************************************************/ + +/* The following requirements are tested: +Restriction h. : Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + +module NegSem_1101_ValueVars_004 { + +type component GeneralComp { +} + + type integer address; + type set of address MySetofInt; + +testcase TC_NegSem_1101_ValueVars_004() runs on GeneralComp { + + var MySetofInt R1:= {[0] := null}; + + var integer Myvar := R1[0]; //error + + if (match(Myvar,R1[0])) { setverdict(pass,"match") } + else { setverdict(fail) } + } + + +control{ + execute(TC_NegSem_1101_ValueVars_004()); +} + +} diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_005.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d64eb0876ef8953e05318a8eb539872b1022356f --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSem_1101_ValueVars_005.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:11.1, Variables should be assigned only by values + ** @verdict pass reject + ***************************************************/ + +// The expression shall evaluate to a value, which is at least partially initialized. + +module NegSem_1101_ValueVars_005 { + type component GeneralComp {} + + testcase TC_NegSem_1101_ValueVars_005() runs on GeneralComp { + var integer v_i; + var integer v_j := v_i + 2; // error: v_i is uninitialized + + setverdict(pass); + } + + control { + execute(TC_NegSem_1101_ValueVars_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/NegSyn_1101_ValueVars_001.ttcn b/ATS/core_language/11_variables/1101_value_variables/NegSyn_1101_ValueVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbf0a88e099990329fdb3a67d43c952cc9cdf0a8 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/NegSyn_1101_ValueVars_001.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Define variables in module scope + ** @verdict pass reject + ***************************************************/ +module NegSyn_1101_ValueVars_001 { + var integer v_i1 := 5; +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_001.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..adcf1243727c0bf1dd736805211d02d1c60ee095 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_001.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Define variables in different scopes + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1101_ValueVars_001 { + type component GeneralComp { + timer t; + var integer vc_i1 := 10; + } + + altstep a_Sem_1101_ValueVars_001() runs on GeneralComp { + var integer v_j := 12; + [] t.timeout { + var integer v_k := 13; + } + } + + function f_Sem_1101_ValueVars_001() runs on GeneralComp { + var integer v_i := 2; + } + + testcase TC_Sem_1101_ValueVars_001() runs on GeneralComp { + var integer v_i := 3; + f_Sem_1101_ValueVars_001(); + + t.start(1.0); + alt { + [] a_Sem_1101_ValueVars_001(); + } + + setverdict(pass); + } + + control { + var integer v_i := 1; + execute(TC_Sem_1101_ValueVars_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_002.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c4b7cb2c8600a7ada9fc9fed094f5e5a01231ed --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Define variables in different scopes + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1101_ValueVars_002 { + type component GeneralComp {} + + testcase TC_Sem_1101_ValueVars_002() runs on GeneralComp { + var boolean v_b := true; + if (v_b){ + setverdict(pass); + } + else { + setverdict(fail); + } + v_b := false; + if (not v_b){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1101_ValueVars_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_003.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d929ffa1daa88da70fa022a6f4c975f0b481403 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_003.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Read and write variables + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1101_ValueVars_003 { + type component GeneralComp { + timer t; + var integer vc_ai[3] := {1, 3, 5}; + } + + testcase TC_Sem_1101_ValueVars_003() runs on GeneralComp { + var integer v_i := 3; + v_i := 5; + vc_ai[1] := 5; + + if (vc_ai[1] == v_i){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_1101_ValueVars_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_004.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69c66ae1a49a09a19efefbebd18ec4c96b2dfe08 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_004.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that partially initialized variables are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1101_ValueVars_004 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +testcase TC_Sem_1101_ValueVars_004() runs on GeneralComp { + var IntegerSet v_set := {a1:=1,a2:=omit}; + v_set.a3 := 3; + + if ( match(v_set, {a1:=1,a2:=omit,a3:=3}) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1101_ValueVars_004()); +} + +} diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_005.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1949a027cdf399be33488eebeedfaa915d695a71 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_005.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.1, Ensure that partially initialized variables are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1101_ValueVars_005 { + +type component GeneralComp { +} + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + +function f_partial () runs on GeneralComp return IntegerSet { + return {a1:=1,a2:=omit}; +} + +testcase TC_Sem_1101_ValueVars_005() runs on GeneralComp { + var IntegerSet v_set := f_partial(); + v_set.a3 := 3; + + if ( match(v_set, {a1:=1,a2:=omit,a3:=3}) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1101_ValueVars_005()); +} + +} diff --git a/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_006.ttcn b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8c4bd3ee5cb621f40239be4cfbc886d343ea8bb --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Sem_1101_ValueVars_006.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:11.1, Variables should be assigned only by values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//formerly: NegSem_1101_ValueVars_006 + +module Sem_1101_ValueVars_006 { + type component GeneralComp {} + + testcase TC_Sem_1101_ValueVars_006() runs on GeneralComp { + var integer v_i := 1; + var @lazy integer v_j := v_i + 2; + + v_i := v_j; + if(v_i == 3){ + setverdict(pass); + } + else{ + setverdict(fail); + } + + + } + + control { + execute(TC_Sem_1101_ValueVars_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1101_value_variables/Syn_1101_ValueVars_001.ttcn b/ATS/core_language/11_variables/1101_value_variables/Syn_1101_ValueVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e50d3211baafd7a76e38cdcb596cbf3d71549023 --- /dev/null +++ b/ATS/core_language/11_variables/1101_value_variables/Syn_1101_ValueVars_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.1, Define variables in different scopes + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_1101_ValueVars_001 { + type component GeneralComp { + var integer vc_i1 := 10; + } + + altstep a_Syn_1101_ValueVars_001() runs on GeneralComp { + var integer v_j := 12; + [] any timer.timeout { + var integer v_k := 13; + } + } + + function f_Syn_1101_ValueVars_001() runs on GeneralComp { + var integer v_i := 2; + } + + testcase TC_Syn_1101_ValueVars_001() runs on GeneralComp { + var integer v_i := 3; + } + + control { + var integer v_i := 1; + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1102_template_variables/NOTES b/ATS/core_language/11_variables/1102_template_variables/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..b3161e54d16d57cb8bf04c371633c93de428b915 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NOTES @@ -0,0 +1,4 @@ +- TODO: use other types as integer +- TODO: init with functions +- TODO: init with expressions +- TODO: init structured types with optional fields diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_001.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5a567643c566d31613102098f12c757945d0436 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_001.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.2, Template variables should be assigned with unitialized variables + ** @verdict pass reject + ***************************************************/ +module NegSem_1102_TemplateVars_001 { + type component GeneralComp {} + + testcase TC_NegSem_1102_TemplateVars_001() runs on GeneralComp { + var template integer v_i1; + var template integer v_i2 := v_i1; // v_i1 is not initialized + + setverdict(pass); + } + + control { + execute(TC_NegSem_1102_TemplateVars_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_002.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..381bf3043cff7b3b71d1af6419d867cfe709c7cc --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_002.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that partially initialized templates are evaluated correctly. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1102_TemplateVars_002 { + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type port loopbackPort message { + inout IntegerSet + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_1102_TemplateVars_002() runs on GeneralComp { + var template IntegerSet mw_pattern := {a1:=1,a2:=*}; + var IntegerSet v_set := {a1:=1,a2:=2,a3:=3} + + messagePort.send(v_set); + + alt { + [] messagePort.receive(mw_pattern) { //attempted matching of partially initialized template + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_NegSem_1102_TemplateVars_002()); +} + +} diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..511e62c7f21a82aa5dd5779c927e7981b0b72472 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_003.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that dot notation referencing to a field, which actual value is null shall cause an error. + ** @verdict pass reject + *****************************************************************/ + +/* The following requirements are tested: +Restriction k.: Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + + +module NegSem_1102_TemplateVars_003 { + + type integer address; + type record MyRecordType + { + address field1, + integer field2 optional + }; + + type port loopbackPort message { + inout integer, address + } + + type component GeneralComp { + port loopbackPort messagePort + } + + + +testcase TC_NegSem_1102_TemplateVars_003() runs on GeneralComp { + + var MyRecordType R1:= {field1 := null, + field2 := -}; + + var template integer v_set := R1.field1; //error + + messagePort.send(R1.field1); + + alt { + [] messagePort.receive(v_set) { + setverdict(pass,v_set); + } + [] messagePort.receive { + setverdict(fail,v_set); + } + } +} +control{ + execute(TC_NegSem_1102_TemplateVars_003()); +} + +} diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b16e22f66e9120ccddfd78518b1727ef9b533642 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSem_1102_TemplateVars_004.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that index notation referencing to a set of, which actual value is null shall cause an error. + ** @verdict pass reject + *****************************************************************/ + +/* The following requirements are tested: +Restriction k. : Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an +error. +*/ + +module NegSem_1102_TemplateVars_004 { + + type integer address; + type set of address MySet; + + type port loopbackPort message { + inout integer + } + + type component GeneralComp { + port loopbackPort messagePort + } + + + +testcase TC_NegSem_1102_TemplateVars_004() runs on GeneralComp { + + var MySet R1:= {[0] := null}; + + var template integer v_set := R1[0]; //error + + messagePort.send(R1[0]); + + alt { + [] messagePort.receive(v_set) { + setverdict(pass,v_set); + } + [] messagePort.receive { + setverdict(fail,v_set); + } + } +} +control{ + execute(TC_NegSem_1102_TemplateVars_004()); +} + +} diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_001.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..382df4bc6cd3c3b1a0f5c037e9877037fd806f13 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_001.ttcn @@ -0,0 +1,9 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.2, Define template variables in module scope + ** @verdict pass reject + ***************************************************/ +module NegSyn_1102_TemplateVars_001 { + var template integer v_i1 := 5; +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_002.ttcn b/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8bfceb74515bf00bcde3b5307ce759b00ddd8dd0 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/NegSyn_1102_TemplateVars_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:11.2, Template variables should be assigned with unitialized variables + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: +Restriction l) The template body at the right-hand side of the assignment symbol shall evaluate to a value or template, which is type compatible with the variable being declared. +*/ + + +module NegSyn_1102_TemplateVars_002 { + type component GeneralComp {} + + testcase TC_NegSyn_1102_TemplateVars_002() runs on GeneralComp { + var integer v_i1 := 1; + var template float v_i2 := v_i1; // error: v_i1 is integer, meanwhile template type is float + + setverdict(pass); + } + + control { + execute(TC_NegSyn_1102_TemplateVars_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_001.ttcn b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e72e06528beec9b56d3e5d4ddf014ae9fa84349e --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_001.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.2, Define variables in different scopes + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1102_TemplateVars_001 { + type component GeneralComp { + timer t; + var template integer vc_i1 := omit; + } + + altstep a_Sem_1102_TemplateVars_001() runs on GeneralComp { + var integer v_j := 12; + [] t.timeout { + var template integer v_k := ?; + } + } + + function f_Sem_1102_TemplateVars_001() runs on GeneralComp { + var template integer v_i := *; + } + + testcase TC_Sem_1102_TemplateVars_001() runs on GeneralComp { + var template integer v_i := (1, 2, 3); + f_Sem_1102_TemplateVars_001(); + + t.start(1.0); + alt { + [] a_Sem_1102_TemplateVars_001(); + } + + setverdict(pass); + } + + control { + var template integer v_i := (1..2); + execute(TC_Sem_1102_TemplateVars_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_002.ttcn b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..11949f9d7d7d12624128f7da258ae87b94a88f3b --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that partially initialized templates are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1102_TemplateVars_002 { + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type port loopbackPort message { + inout IntegerSet + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_1102_TemplateVars_002() runs on GeneralComp { + var template IntegerSet mw_pattern := {a1:=1,a2:=*}; + var IntegerSet v_set := {a1:=1,a2:=2,a3:=3} + mw_pattern.a3 := 3; + + messagePort.send(v_set); + + alt { + [] messagePort.receive(mw_pattern) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_1102_TemplateVars_002()); +} + +} diff --git a/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_003.ttcn b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a4ec70618cb5bbfe7b4c53d9119440fc20f7c49 --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/Sem_1102_TemplateVars_003.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:11.2, Ensure that partially initialized templates are evaluated correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1102_TemplateVars_003 { + + type set IntegerSet { + integer a1 optional, + integer a2 optional, + integer a3 optional + }; + + type port loopbackPort message { + inout IntegerSet + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_partial () runs on GeneralComp return template IntegerSet { + var template IntegerSet mw_return := {a1:=1,a2:=*}; + + return mw_return; +} + +testcase TC_Sem_1102_TemplateVars_003() runs on GeneralComp { + var template IntegerSet mw_pattern := f_partial(); + var IntegerSet v_set := {a1:=1,a2:=2,a3:=3} + mw_pattern.a3 := 3; + + messagePort.send(v_set); + + alt { + [] messagePort.receive(mw_pattern) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_1102_TemplateVars_003()); +} + +} diff --git a/ATS/core_language/11_variables/1102_template_variables/Syn_1102_TemplateVars_001.ttcn b/ATS/core_language/11_variables/1102_template_variables/Syn_1102_TemplateVars_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37d541e052bf42ce160a3207c0db7fb8ddd51e1f --- /dev/null +++ b/ATS/core_language/11_variables/1102_template_variables/Syn_1102_TemplateVars_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:11.2, Define template variables in different scopes + ** @verdict pass accept, noexecution + ***************************************************/ +module Syn_1102_TemplateVars_001 { + type component GeneralComp { + var template integer vc_i1 := omit; + } + + altstep a_Syn_1102_TemplateVars_001() runs on GeneralComp { + var integer v_j := 12; + [] any timer.timeout { + var template integer v_k := ?; + } + } + + function f_Syn_1102_TemplateVars_001() runs on GeneralComp { + var template integer v_i := *; + } + + testcase TC_Syn_1102_TemplateVars_001() runs on GeneralComp { + var template integer v_i := (1, 2, 3); + } + + control { + var template integer v_i := (1..2); + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_001.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da1cdd1116fe0c54a616f28e7643f926b85c278f --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can not be initialized with negative duration + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer value is non-neg float + **/ + + +module NegSem_12_toplevel_timer_001 { + type component TComp{ + timer t_timer := -1.0; // not allowed + } + testcase TC_NegSem_12_toplevel_timer_001() runs on TComp{ + t_timer.start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_001()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_002.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..483f426cafe608fa79ef637bb55e4c0f7b89050a --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer in array can not be initialized with negative duration + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer value is non-neg float + **/ + + +module NegSem_12_toplevel_timer_002 { + type component TComp{ + timer t_timer[2] := {-1.0, 1.0}; + } + testcase TC_NegSem_12_toplevel_timer_002() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_002()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_003.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50b5139576469f4ebf7924ca1a306a03babe43c6 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure uninitialized timer can't be started + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSem_12_toplevel_timer_003 { + type component TComp{ + timer t_timer; + } + testcase TC_NegSem_12_toplevel_timer_003() runs on TComp{ + t_timer.start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_003()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_004.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e5564c8095c2e6e7a41528452a77e78fc605481 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure uninitialized timer in array can't be started + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSem_12_toplevel_timer_004 { + type component TComp{ + timer t_timer[2] := {-, 1.0}; + } + testcase TC_NegSem_12_toplevel_timer_004() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_004()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_005.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46be91bc30cc22b063b4ea2885e9525847732d46 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure uninitialized timer in array can't be started + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSem_12_toplevel_timer_005 { + type component TComp{ + timer t_timer[2]; + } + testcase TC_NegSem_12_toplevel_timer_005() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_005()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_006.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c3180d4b1f6dae2a6d8243e2451c2cf845c0873d --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax - reject single timer instance initialized with array + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSem_12_toplevel_timer_006 { + type component TComp{ + timer t_timer := {1.0, 1.0, 1.0}; + } + testcase TC_NegSem_12_toplevel_timer_006() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_006()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_007.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3efac6fe0924adfcad78e5e26a2f561b29365235 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_007.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax -- reject array initialization with wrong number of initializers + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSem_12_toplevel_timer_007 { + type component TComp{ + timer t_timer[4] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSem_12_toplevel_timer_007() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSem_12_toplevel_timer_007()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_008.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be433abc6c0822a61387fe54f9153a49d13d447f --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSem_12_toplevel_timer_008.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax -- reject array of timers initizlized with a single float value + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_008 { + type component TComp{ + timer t_timer[4] := 1.0; + } + testcase TC_NegSyn_12_toplevel_timer_008() runs on TComp{ + t_timer[0].start; + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_008()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_001.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3699c298bae58a39c03ef6888dce14537e51dc0d --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can`t be used in module control parts when declared in components + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timers can be declared in component and used in test cases, functions, altsteps on this component + **/ + + +module NegSyn_12_toplevel_timer_001 { + type component TComp{ + timer t_timer:=01.0; + } + testcase TC_NegSyn_12_toplevel_timer_001(integer f) runs on TComp{ + if (f==0){ + setverdict(fail); + } + else{ + setverdict(pass); + } + } + control{ + + t_timer.start; + if (t_timer.running){ + execute(TC_NegSyn_12_toplevel_timer_001(0)) + } + else{ + execute(TC_NegSyn_12_toplevel_timer_001(1)) + } + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_002.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e93b2608de5ab30cd59118cc8af620d4d793835e --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_002 { + type component TComp{ + timer :=10.0; + } + testcase TC_NegSyn_12_toplevel_timer_002() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_002()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_003.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c5a82a02b0703b2e60593ca8aaf26eaf7a37fcf --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_003 { + type component TComp{ + timer t_timer :=; + } + testcase TC_NegSyn_12_toplevel_timer_003() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_003()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_004.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..deb70c3b9ca7b6ea8116cd0da7363c77af6a96be --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:04, Ensure timer declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_04_toplevel_timer_004 { + type component TComp{ + timer t_timer 0.0; + } + testcase TC_NegSyn_04_toplevel_timer_004() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_04_toplevel_timer_004()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_005.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8dbfd619a92ec488305552f805b4e603e44f9181 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_005 { + type component TComp{ + timer t_timer := 1; + } + testcase TC_NegSyn_12_toplevel_timer_005() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_005()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_006.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ff1af2952c6062078454687fcf96cc12111c56b --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer array declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_006 { + type component TComp{ + timer t_timer[5] := 1.0, 1.0, 1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_12_toplevel_timer_006() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_006()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_007.ttcn b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c691846857732896e2981d13f1a7df5021af3ede --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/NegSyn_12_toplevel_timer_007.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer array declaration syntax + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module NegSyn_12_toplevel_timer_007 { + type component TComp{ + timer t_timer[5] := {1.0 1.0, 1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_12_toplevel_timer_007() runs on TComp{ + + } + control{ + + execute(TC_NegSyn_12_toplevel_timer_007()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_001.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9875624cf1017bfd32fcd718b73c9f21c144f6d9 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in components + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timers can be declared in component type + **/ + + +module Sem_12_toplevel_timer_001 { + type component TComp{ + timer t_timer:=10.0; + } + testcase TC_Sem_12_toplevel_timer_001() runs on TComp{ + t_timer.start; + if (t_timer.running){ + setverdict(pass) + } + else { + setverdict(fail) + } + } + control{ + execute(TC_Sem_12_toplevel_timer_001()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_002.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..981e386dee1a50f28172847baad3843616600647 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_002.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in module control parts + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer can be declared in module control, test cases, functions, altsteps + **/ + + +module Sem_12_toplevel_timer_002 { + type component TComp{ + } + testcase TC_Sem_12_toplevel_timer_002(verdicttype v_verdict) runs on TComp{ + setverdict(v_verdict); + } + control{ + timer t_timer:=10.0; + t_timer.start; + if (t_timer.running){ + execute(TC_Sem_12_toplevel_timer_002(pass)) + } + else{ + execute(TC_Sem_12_toplevel_timer_002(fail)) + } + + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_003.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41000545cd308d9fbc160ac160c103ab49797a97 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer can be declared in module control, test cases, functions, altsteps + **/ + + +module Sem_12_toplevel_timer_003 { + type component TComp{ + timer aux_t; + } + altstep a_step () runs on TComp{ + timer t_timer:=3.0; + [] aux_t.timeout{ + t_timer.start; + if (t_timer.running){ + setverdict(pass); + stop; + } + else{ + setverdict(fail); + stop; + } + t_timer.stop; + } + + }; + testcase TC_Sem_12_toplevel_timer_003() runs on TComp{ + aux_t.start(0.0); + a_step(); + } + control{ + execute(TC_Sem_12_toplevel_timer_003()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_004.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa54de52f43555d07efaf39ca4d0e767bbc604f3 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer can be declared in module control, test cases, functions, altsteps + **/ + + +module Sem_12_toplevel_timer_004 { + type component TComp{ + } + function func() + { + timer t_timer:=10.0; + t_timer.start; + if (t_timer.running){ + setverdict(pass); + } + else { + setverdict(fail); + } + + } + testcase TC_Sem_12_toplevel_timer_004() runs on TComp{ + func(); + } + control{ + execute(TC_Sem_12_toplevel_timer_004()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_005.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd2e2fcba9700a4568458a9e13a466a710426f4a --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer can be declared in module control, test cases, functions, altsteps + **/ + + +module Sem_12_toplevel_timer_005 { + type component TComp{ + } + testcase TC_Sem_12_toplevel_timer_005() runs on TComp{ + timer t_timer:=10.0; + t_timer.start; + if (t_timer.running){ + setverdict(pass); + } + else{ + setverdict(fail); + } + } + control{ + execute(TC_Sem_12_toplevel_timer_005()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_006.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd4446e8c0c46a3afbd46d6b14a9863f881d4824 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_006.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer`s elapsed time is plausible + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer value is non-neg float + **/ + + +module Sem_12_toplevel_timer_006 { + type component TComp{ + timer t_timer1:=1.05; + timer t_timer2:=1.0; + timer t_timer3:=0.95; + } + altstep a_step() runs on TComp{ + []t_timer2.timeout{ + if (match(t_timer3.running, false) and t_timer1.running){ + setverdict(pass); + } + else { + setverdict(fail); + } + } + []t_timer1.timeout{ + setverdict(fail); + } + } + testcase TC_Sem_12_toplevel_timer_006() runs on TComp{ + + t_timer1.start; + t_timer2.start; + t_timer3.start; + a_step(); + + } + control{ + execute(TC_Sem_12_toplevel_timer_006()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_007.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..afe39d70d5c22b4be8b3c13a636937272b9d4021 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_007.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in components but used in test cases + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timers can be declared in component and used in test cases, functions, altsteps on this component + **/ + + +module Sem_12_toplevel_timer_007 { + type component TComp{ + timer t_timer:=10.0; + } + testcase TC_Sem_12_toplevel_timer_007() runs on TComp{ + + t_timer.start; + if (t_timer.running){ + setverdict(pass); + } + else{ + setverdict(fail); + } + } + control{ + execute(TC_Sem_12_toplevel_timer_007()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_008.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86f3625077242db0347481d5619dd7d9c4a3c849 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_008.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in components but used in functions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timers can be declared in component and used in test cases, functions, altsteps on this component + **/ + + +module Sem_12_toplevel_timer_008 { + type component TComp{ + timer t_timer:=10.0; + } + function func() runs on TComp + { + + t_timer.start; + if (t_timer.running){ + setverdict( pass ); + } + else { + setverdict( fail ); + } + + } + testcase TC_Sem_12_toplevel_timer_008() runs on TComp{ + func(); + } + control{ + execute(TC_Sem_12_toplevel_timer_008()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_009.ttcn b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e4b8ba2f5dda9bba342dcd89d982d08f172637e --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Sem_12_toplevel_timer_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer can be declared in components but used in altsteps + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timers can be declared in component and used in test cases, functions, altsteps on this component + **/ + + +module Sem_12_toplevel_timer_009 { + type component TComp{ + timer aux_t; + timer t_timer:=10.0; + } + altstep a_step () runs on TComp{ + + [] aux_t.timeout{ + t_timer.start; + if (t_timer.running){ + setverdict(pass); + } + else{ + setverdict(fail); + } + } + + }; + testcase TC_Sem_12_toplevel_timer_009() runs on TComp{ + aux_t.start(0.0); + a_step(); + } + control{ + execute(TC_Sem_12_toplevel_timer_009()) + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_001.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15423ab02fd39e87b8fa053d1f8d0358224766cf --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_001.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure non-initialized timer declaration syntax + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module Syn_12_toplevel_timer_001 { + type component TComp{ + timer t_timer; + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_002.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab6ee4cd527334e27b0c6bcf5911b5d34a08cbb4 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_002.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer array declaration syntax + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module Syn_12_toplevel_timer_002 { + type component TComp{ + timer t_timer[5]; + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_003.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bda5a47ce96f72ff9907b5bb06ac65e832bd91f --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_003.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure definition of a list of timers is allowed as a single declaration + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module Syn_12_toplevel_timer_003 { + type component TComp{ + timer t_timer1, t_timer2 := 2.0, t_timer_array1[5], t_timer_array2[3] := {0.0, 1.0, 2.0}; + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_004.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..587df8cd8def42acc5b200bc35cedf45ae9eedc3 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_004.ttcn @@ -0,0 +1,16 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer array initialization syntax + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/timer array values are non-neg float or minus + **/ + + +module Syn_12_toplevel_timer_004 { + type component TComp{ + timer t_timer[5] := {1.0, -, 1.0, 1.0, 1.0}; + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_005.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e36389ee5c82869e7ec31b6aa2d762be8dc322f3 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_005.ttcn @@ -0,0 +1,17 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration with expression + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module Syn_12_toplevel_timer_006 { + control { + var anytype v_any := { float := 1.0 }; + timer t_timer := v_any.float; + } +} \ No newline at end of file diff --git a/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_006.ttcn b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..038d46c60f4d74d29a11ae87e8110e73f181c238 --- /dev/null +++ b/ATS/core_language/12_timers/12_toplevel/Syn_12_toplevel_timer_006.ttcn @@ -0,0 +1,20 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure timer declaration with expression + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/12 Declaring timers/Timer declaration syntax + **/ + + +module Syn_12_toplevel_timer_005 { + function one() return float + { + return 1.0; + } + control { + timer t_timer := one(); + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_001.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c22572b4886ccdacfb776b993bfbeee94653c436 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_001.ttcn @@ -0,0 +1,146 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:12, Ensure received messages can be a combination of value and matching mechanism + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Messages are instances of types declared in the in-out-inout clauses of message port type definition + **/ +/* + * #reqname /Requirements/13 Declaring messages/Received messages can also be declared as a combination of value and matching mechanisms + **/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Variable as a message + **/ + + +module Sem_13_declaring_msg_001 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + var MsgType1 msg1 := c_message; + src.send(msg1); + } + + function f_receiver() runs on Receiver + { + template MsgType1 t_msg := { + i := 1, + k:=1.0, + b:=true, + v:=pass, + bs:='0101'B, + hs:='123ABD'H, + os:='FF96'O, + cs:="""ab""", + ucs:="the", + rec1:={i:=1}, + set1:={int1:=1, str1:="the"}, + union1:=make_union(), + enum1:=Bash, + arr1:={1,2,3}}; + + var MsgType1 v_message; + + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(t_msg) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail, "The template failed to match the message"); } + } + } + + testcase TC_Sem_13_declaring_msg_001() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_001()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_002.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bfb5b1066da6ccc9d1b8d2188f50fc9cd0cb10bf --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_002.ttcn @@ -0,0 +1,127 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure received messages can`t be matched with wrong template + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Received messages can also be declared as a combination of value and matching mechanisms + **/ + + +module Sem_13_declaring_msg_002 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + var MsgType1 msg1 := c_message; + src.send(msg1); + } + + function f_receiver() runs on Receiver + { + // Mismatch in fields i and k + template MsgType1 t_msg := {i := 2, k:=1.3, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, union1 := ?, arr1:={1,2,3}}; + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(t_msg) -> value v_message { setverdict(fail, "The template must not match the message"); } + [] t_timer.timeout { setverdict(pass); } + } + } + + testcase TC_Sem_13_declaring_msg_002() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_002()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_003.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34cea5903a6a37c695abb75307981f33590590df --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_003.ttcn @@ -0,0 +1,128 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared by in-line templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Variable as a message + **/ + + +module Sem_13_declaring_msg_003 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + var MsgType1 msg1 := c_message; + src.send(msg1); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(MsgType1: {1, 1.0, true, pass, '0101'B, '123ABD'H, 'FF96'O, + """ab""", "the", {i:=1}, {int1:=1, str1:="the"}, make_union(), Bash, {1,2,3}}) + -> value v_message + { + setverdict(pass); + } + [] t_timer.timeout { setverdict(fail, "The template failed to match the message"); } + } + } + + testcase TC_Sem_13_declaring_msg_003() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_003()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_004.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2fb42c3455c86d6c5ddd86fa755964eafbd9ec0 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_004.ttcn @@ -0,0 +1,131 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared by global templates + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Global template as a message + **/ + + +module Sem_13_declaring_msg_004 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + + function f_sender() runs on Sender + { + src.send(global); + } + + function f_receiver() runs on Receiver + { + template MsgType1 local:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := ?, rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(local) { setverdict(pass); } + [] t_timer.timeout { setverdict(fail, "Failed to match global template"); } + } + } + + testcase TC_Sem_13_declaring_msg_004() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_004()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_005.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f334e7dfb015531a27b5819a577aeb3a85c9f712 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_005.ttcn @@ -0,0 +1,137 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared and passed via template variables + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Template variable as a message + **/ + + +module Sem_13_declaring_msg_005 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + function f_sender() runs on Sender + { + var template MsgType1 template_var:= { + i := 1, k:=1.0, b:=true, v:=pass, + bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", + union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + src.send(template_var); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(global) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail); } + } + } + + testcase TC_Sem_13_declaring_msg_005() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_005()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_006.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce10a402b3ecfa6b08838f8278b7b118672c383d --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_006.ttcn @@ -0,0 +1,135 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared and passed via inline template + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Inline template as a message + **/ + + +module Sem_13_declaring_msg_006 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + function f_sender() runs on Sender + { + src.send(MsgType1:{ + i := 1, k:=1.0, b:=true, v:=pass, + bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", + union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(global) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail); } + } + } + + testcase TC_Sem_13_declaring_msg_006() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_006()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_007.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f242a2ca7a68ee3b2f55c0bfcb354af9bfdb92da --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_007.ttcn @@ -0,0 +1,136 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared and passed via parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Parameter as a message + **/ + + +module Sem_13_declaring_msg_007 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + function f_sender(in MsgType1 v_message) runs on Sender + { + src.send(v_message); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(global) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail); } + } + } + + testcase TC_Sem_13_declaring_msg_007() runs on MTC system MTC + { + var MsgType1 v_message := { + i := 1, k:=1.0, b:=true, v:=pass, + bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", + union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender(v_message)); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_007()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_008.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2dd5dc8d3bd0925051a3fc226d3194b803a07aba --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_008.ttcn @@ -0,0 +1,136 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared and passed via template parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Template parameter as a message + **/ + + +module Sem_13_declaring_msg_008 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + function f_sender(template MsgType1 v_template_message) runs on Sender + { + src.send(v_template_message); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(global) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail); } + } + } + + testcase TC_Sem_13_declaring_msg_008() runs on MTC system MTC + { + var template MsgType1 v_template_message := { + i := 1, k:=1.0, b:=true, v:=pass, + bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", + union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender(v_template_message)); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control{ + + execute(TC_Sem_13_declaring_msg_008()) + + + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_009.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cd6ac7293c2d835af23a40bb6171fcd1def835e --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_declaring_msg_009.ttcn @@ -0,0 +1,133 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure instances of messages can be declared and passed via template parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/13 Declaring messages/Sorts of message insances/Local template as a message + **/ + + +module Sem_13_declaring_msg_009 { + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort1 message{ + out MsgType1; + in MsgType2; + } + type port MyPort2 message{ + out MsgType2; + in MsgType1; + } + type component Sender{ + port MyPort1 src; + } + + type component Receiver{ + port MyPort2 dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_message := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := """ab""", + ucs := "the", + rec1 := {i:=1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + template MsgType1 global:= {i := 1, k:=1.0, b:=true, v:=pass, bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + + function f_sender() runs on Sender + { + template MsgType1 v_template_message := { + i := 1, k:=1.0, b:=true, v:=pass, + bs:='0101'B, hs:='123ABD'H, + os:='FF96'O, cs:="""ab""", ucs:="the", + union1 := make_union(), + rec1:={i:=1}, set1:={int1:=1, str1:="the"}, + enum1:=Bash, arr1:={1,2,3} + }; + src.send(v_template_message); + } + + function f_receiver() runs on Receiver + { + var MsgType1 v_message; + timer t_timer := 3.0; + t_timer.start; + alt + { + [] dst.receive(global) -> value v_message { setverdict(pass); } + [] t_timer.timeout { setverdict(fail); } + } + } + + testcase TC_Sem_13_declaring_msg_009() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.done; + } + control { + execute(TC_Sem_13_declaring_msg_009()) + } +} \ No newline at end of file diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_001.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..423f8603870ad7adfba6e93c67186302add9e83e --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_001.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'record' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_001{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // CompositeType + t_timer.start; + src.send(c_values.rec1); + alt { + [] src.receive(c_values.rec1) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected CompositeType ", c_values.rec1); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.rec1) { setverdict(pass); dst.send(c_values.rec1); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected CompositeType", c_values.rec1); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_001() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_001()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_002.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..77da73c7f82b4d5276a81677b760cd5ab080abd3 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_002.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'record of' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_002{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // MyArray + t_timer.start; + src.send(c_values.arr1); + alt { + [] src.receive(c_values.arr1) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected MyArray ", c_values.arr1); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.arr1) { setverdict(pass); dst.send(c_values.arr1); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected MyArray", c_values.arr1); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_002() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_002()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_003.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9695fa8227678dc7d1cf3657dedc9df65eee1a5 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_003.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'enum' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_003{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // MyEnum + t_timer.start; + src.send(c_values.enum1); + alt { + [] src.receive(c_values.enum1) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected MyEnum ", c_values.enum1); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.enum1) { setverdict(pass); dst.send(c_values.enum1); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected MyEnum", c_values.enum1); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_003() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_003()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_004.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47627c672f2e731854723c1a84f78e0ad0ed938a --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_004.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'set' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_004{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // MySet + t_timer.start; + src.send(c_values.set1); + alt { + [] src.receive(c_values.set1) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected MySet ", c_values.set1); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.set1) { setverdict(pass); dst.send(c_values.set1); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected MySet", c_values.set1); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_004() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_004()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_005.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2bf711a8472cb53ae072262643d45bc73e2931b --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_005.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'union' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_005{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // MyUnion + t_timer.start; + src.send(c_values.union1); + alt { + [] src.receive(c_values.union1) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected MyUnion ", c_values.union1); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.union1) { setverdict(pass); dst.send(c_values.union1); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected MyUnion", c_values.union1); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_005() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_005()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_006.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01dc5d2b63fab1d147f51767016e9c5eb4c711bc --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_006.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'bitstring' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_006{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // bitstring + t_timer.start; + src.send(c_values.bs); + alt { + [] src.receive(c_values.bs) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected bitstring ", c_values.bs); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.bs) { setverdict(pass); dst.send(c_values.bs); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected bitstring", c_values.bs); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_006() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_006()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_007.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed17724eb7723becbabf27bf444ca5c35d3070f4 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_007.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'boolean' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_007{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // boolean + t_timer.start; + src.send(c_values.b); + alt { + [] src.receive(c_values.b) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected boolean ", c_values.b); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.b) { setverdict(pass); dst.send(c_values.b); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected boolean", c_values.b); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_007() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_007()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_008.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94cd25f77b916d0b97364e174a2ed6416a3cc865 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_008.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'charstring' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_008{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // charstring + t_timer.start; + src.send(c_values.cs); + alt { + [] src.receive(c_values.cs) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected charstring ", c_values.cs); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.cs) { setverdict(pass); dst.send(c_values.cs); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected charstring", c_values.cs); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_008() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_008()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_009.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47ce6fc23c743d40569ea34559fb83d19c6f1c17 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_009.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'float' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_009{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // float + t_timer.start; + src.send(c_values.k); + alt { + [] src.receive(c_values.k) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected float ", c_values.k); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.k) { setverdict(pass); dst.send(c_values.k); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected float", c_values.k); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_009() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_009()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_010.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..705bd0b8c62c699d9a0ba5d86aa181a86ea4f026 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_010.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'hexstring' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_010{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // hexstring + t_timer.start; + src.send(c_values.hs); + alt { + [] src.receive(c_values.hs) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected hexstring ", c_values.hs); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.hs) { setverdict(pass); dst.send(c_values.hs); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected hexstring", c_values.hs); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_010() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_010()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_011.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b36aa92d8f1d85f6252beafb595be1df9df00962 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_011.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'integer' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_011{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // integer + t_timer.start; + src.send(c_values.i); + alt { + [] src.receive(c_values.i) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected integer ", c_values.i); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.i) { setverdict(pass); dst.send(c_values.i); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected integer", c_values.i); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_011() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_011()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_012.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42bf86a6b72d33ebc9a7113903ea42bacba2011a --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_012.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'octetstring' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_012{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // octetstring + t_timer.start; + src.send(c_values.os); + alt { + [] src.receive(c_values.os) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected octetstring ", c_values.os); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.os) { setverdict(pass); dst.send(c_values.os); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected octetstring", c_values.os); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_012() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_012()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_013.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6e46b68c0fd95de771cda367d33bb5231bc3040 --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_013.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'universal charstring' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_013{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // universal charstring + t_timer.start; + src.send(c_values.ucs); + alt { + [] src.receive(c_values.ucs) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected universal charstring ", c_values.ucs); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.ucs) { setverdict(pass); dst.send(c_values.ucs); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected universal charstring", c_values.ucs); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_013() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_013()) + } +} diff --git a/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_014.ttcn b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b25fa8e90658cfca91f9a3627e1e09b3fef27afe --- /dev/null +++ b/ATS/core_language/13_messages/13_toplevel/Sem_13_toplevel_declaring_msg_various_types_014.ttcn @@ -0,0 +1,142 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:13, Port with type anytype can send and receive messages of any basic or structured type: 'verdicttype' type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/13 Declaring messages/Any type can be declared as type of message in a message port type + + +module Sem_13_toplevel_declaring_msg_various_types_014{ + type record CompositeType{ + integer i + } + type set MySet{ + integer int1, + charstring str1 + } + type enumerated MyEnum{ + Perl,Bash,Python + } + type integer MyArray[3]; + type union MyUnion{ + integer int, + float real + } + type record MsgType1{ + integer i, + float k, + boolean b, + verdicttype v, + bitstring bs, + hexstring hs, + octetstring os, + charstring cs, + universal charstring ucs, + CompositeType rec1, + MySet set1, + MyUnion union1, + MyEnum enum1, + MyArray arr1 + } + type record MsgType2{ + integer j + } + + type port MyPort message{ + inout integer; + inout float; + inout boolean; + inout verdicttype; + inout bitstring; + inout hexstring; + inout octetstring; + inout charstring; + inout universal charstring; + inout CompositeType; + inout MySet; + inout MyUnion; + inout MyEnum; + inout MyArray; + } + + type component Sender{ + timer t_timer := 2.0; + port MyPort src; + } + + type component Receiver{ + port MyPort dst; + } + type component MTC {} + + function make_union() return MyUnion + { + var MyUnion result; + result.int := 1; + return result; + } + + const MsgType1 c_values := { + i := 1, + k := 1.0, + b := true, + v := pass, + bs := '0101'B, + hs := '123ABD'H, + os := 'FF96'O, + cs := "ab", + ucs := "the", + rec1 := {1}, + set1 := {int1:=1, str1:="the"}, + union1 := make_union(), + enum1 := Bash, + arr1 := {1,2,3} + }; + + function f_sender() runs on Sender + { + // verdicttype + t_timer.start; + src.send(c_values.v); + alt { + [] src.receive(c_values.v) { setverdict(pass); } + [] src.receive { + setverdict(fail, "Unexpected data, expected verdicttype ", c_values.v); + stop; + } + [] t_timer.timeout { + setverdict(fail, "No response from echo service"); + stop; + } + } + } + + function f_receiver() runs on Receiver + { + timer t_timer := 30.0; + t_timer.start; + alt + { + [] dst.receive(c_values.v) { setverdict(pass); dst.send(c_values.v); } + + [] dst.receive { setverdict(fail, "Unexpected messagem expected verdicttype", c_values.v); stop; } + [] t_timer.timeout { setverdict(fail, "No more messages"); stop; } + } + } + + testcase TC_Sem_13_toplevel_declaring_msg_various_types_014() runs on MTC system MTC + { + var Sender c_sender := Sender.create; + var Receiver c_receiver := Receiver.create; + connect(c_sender:src, c_receiver:dst); + c_sender.start(f_sender()); + c_receiver.start(f_receiver()); + c_sender.done; + c_receiver.kill; + } + control { + execute(TC_Sem_13_toplevel_declaring_msg_various_types_014()) + } +} diff --git a/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_001.ttcn b/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c821b6951e523dcdf496544c0478ed0bec133161 --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_001.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that nonblocking signature contains in parameter + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1400_procedure_signatures_001 { + + signature p_procedure_signatures_001(out integer p_par1) noblock; // noblock keyword, shall only have in parameters + + template p_procedure_signatures_001 s_returnTemplate := { + p_par1 := - } + + type port remotePort procedure { + inout p_procedure_signatures_001; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { } + + testcase TC_NegSem_1400_procedure_signatures_001() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_1400_procedure_signatures_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_002.ttcn b/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36a4328d80ab5bb5d1fd13cc6e6c89fa990ba00b --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/NegSem_1400_procedure_signatures_002.ttcn @@ -0,0 +1,73 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that blocking calls needs response or exception handling + ** @verdict pass reject + *****************************************************************/ +// Multiple calls requires response or exception handling if the signature is blocking + +module NegSem_1400_procedure_signatures_002 { + + signature p_Sig1_001( in charstring key ); // noblock needed for multiple calls without response or exections + + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + + function f_Server() runs on GeneralComp { + timer t_guard; + + const charstring key[3] := {"My String1", "hello", "Probe string"}; + + t_guard.start( 5.0 ); + + for ( var integer i := 0; i < 3; i := i + 1 ) { + PCO.call( p_Sig1_001:{key[i]});} + setverdict(pass); + + t_guard.timeout; + setverdict(fail); + } + + function f_client() runs on GeneralComp { + + } + + testcase TC_NegSem_1400_procedure_signatures_002() runs on GeneralComp system GeneralComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + + connect(server:PCO, client:PCO); + + server.start(f_Server()); + client.start(f_client()); + + + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_1400_procedure_signatures_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_001.ttcn b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e58ba32ee6c24387e683cb8c18d9e9d7e6faa32 --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_001.ttcn @@ -0,0 +1,79 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that the IUT calls signature exception + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Exception is a charstring + +module Sem_1400_procedure_signatures_001 { + + signature p_Sig1_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer + exception (charstring); //execption is a string + + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + + function f_Server() runs on GeneralComp { + PCO.raise(p_Sig1_001,"My string"); // raise exception + } + + function f_client() runs on GeneralComp { + timer t_timeout:=30.0; + + t_timeout.start; + + alt { + [] PCO.catch(p_Sig1_001,charstring:"My string") { + setverdict(pass); // receive exception + } + [] PCO.catch(p_Sig1_001,charstring:?) // receive anything else + { + setverdict(fail); + } + + [] t_timeout.timeout { + setverdict(fail); + } + + } +} + + testcase TC_Sem_1400_procedure_signatures_001() runs on GeneralComp system GeneralComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + + connect(server:PCO, client:PCO); + + + server.start(f_Server()); + client.start(f_client()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1400_procedure_signatures_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_002.ttcn b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6914e3b6a4a655ea5e6155404163c321abd415e0 --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_002.ttcn @@ -0,0 +1,80 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that with noblock signature the IUT can raise exception + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Singature exception is a charsting with noblock signature + +module Sem_1400_procedure_signatures_002 { + + signature p_Sig1_001(in integer p_par1) noblock + exception (charstring); //execption is a string + + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + + function f_Server() runs on GeneralComp { + PCO.raise(p_Sig1_001,"My string"); // raise exception + } + + function f_client() runs on GeneralComp { + timer t_timeout:=30.0; + + t_timeout.start; + + alt { + + [] PCO.catch(p_Sig1_001,charstring:"My string") { + setverdict(pass); // receive exception + } + + [] PCO.catch(p_Sig1_001,charstring:?) //receive anything else + { + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + + } +} + + testcase TC_Sem_1400_procedure_signatures_002() runs on GeneralComp system GeneralComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + + connect(server:PCO, client:PCO); + + + server.start(f_Server()); + client.start(f_client()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1400_procedure_signatures_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_003.ttcn b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e647a4ff50168d2696172c574c4c6ace119322c --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_003.ttcn @@ -0,0 +1,72 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that non blocking signatures can raise exception + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Singature exception is an integer + +module Sem_1400_procedure_signatures_003 { + + signature p_Sig1_001(in integer p_par1) noblock + exception (integer); //execption is an integer + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + + function f_Server() runs on GeneralComp { + PCO.raise(p_Sig1_001,5); // raise exception + } + + function f_client() runs on GeneralComp { + timer t_timeout:=30.0; + var integer temp; + t_timeout.start; + + PCO.catch(p_Sig1_001,integer:5)-> value temp; + if (temp==5) + { + setverdict(pass); // receive exception + } + else{ + setverdict(fail); + } +} + + testcase TC_Sem_1400_procedure_signatures_003() runs on GeneralComp system GeneralComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + + + connect(server:PCO, client:PCO); + + + server.start(f_Server()); + client.start(f_client()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1400_procedure_signatures_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_004.ttcn b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c855f8f905c45648be90fbd17d854de2d46dff17 --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/Sem_1400_procedure_signatures_004.ttcn @@ -0,0 +1,68 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:14, Ensure that multiple calls can be send without ack using non-blocking signature + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Multiple calls without response or execption need noblock signature + +module Sem_1400_procedure_signatures_004 { + + signature p_Sig1_001( in charstring key ) noblock; + + + type port remotePort procedure { + inout p_Sig1_001; + } + + type component GeneralComp { + port remotePort PCO; + var integer MyComp; + } + + type component SystemComp { + } + + const charstring key[3] := {"My String1", "hello", "Probe string"}; + + function f_Server() runs on GeneralComp { + for (var integer i := 0; i < lengthof(key); i := i + 1) { + PCO.getcall(p_Sig1_001:{key[i]}); + } + setverdict(pass); + } + + function f_client() runs on GeneralComp { + for (var integer i := 0; i < lengthof(key); i := i + 1) { + PCO.call(p_Sig1_001:{key[i]}) ; + } + } + + testcase TC_Sem_1400_procedure_signatures_004() runs on GeneralComp system SystemComp { + + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + timer t_guard; + + connect(server:PCO, client:PCO); + + server.start(f_Server()); + client.start(f_client()); + + t_guard.start( 5.0 ); + alt { + [] all component.done {} + [] t_guard.timeout { + setverdict(fail); + all component.stop; + } + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1400_procedure_signatures_004(), 10.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_001.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..84826f0fa44752c976410e5d50f8873f9b761ca5 --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_001.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that a simple record-based message template can be defined. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_001 { + +type record MyMessageType { + integer field1 optional, + charstring field2, + boolean field3 +} + +template MyMessageType m_myTemplate := { + field1 := omit, + field2 := "My string", + field3 := true +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_002.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0265387b1df88ea9290f9bff6b25aaf89554c595 --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_002.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that a simple record-based message template with a wildcard ? is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_002 { + +type record MyMessageType { + integer field1 optional +} + +template MyMessageType m_myTemplate := { + field1 := ? +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_003.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37098c45100a175969ad3462278ce55439eb0a73 --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_003.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that a simple record-based message template can be defined with a pattern in a charstring field. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_003 { + +type record MyMessageType { + charstring field2 +} + +template MyMessageType m_myTemplate := { + field2 := pattern "abc*xyz" +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_004.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0feba64438356cb980a297189ff362a4e486b35 --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_004.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that a primitive type template can be defined with a ? wildcard. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_004 { + +template integer m_myTemplate := ?; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_005.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae06a7cfb0583bec18a67cc4c81ae988b0b7328d --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_005.ttcn @@ -0,0 +1,12 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that a primitive type template can be defined with a one-of notation. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_005 { + +template integer m_myTemplate := (1, 2, 3); + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_006.ttcn b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72fbf90a9c33bfc27903cf3962555a71366f6731 --- /dev/null +++ b/ATS/core_language/15_templates/1501_declaring_message_templates/Syn_1501_DeclaringMessageTemplates_006.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.1, Ensure that all port operations are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1501_DeclaringMessageTemplates_006 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1 optional, + charstring field2, + boolean field3 + } + + template MyMessageType m_myTemplate := { + field1 := omit, + field2 := "My string", + field3 := true + } + + testcase TC_Syn_1501_DeclaringMessageTemplates_006() runs on GeneralComp { + pt_myPort.send(m_myTemplate); + pt_myPort.receive(m_myTemplate); + pt_myPort.trigger(m_myTemplate); + pt_myPort.check(receive(m_myTemplate)); + setverdict(pass); + } + + control{ + execute(TC_Syn_1501_DeclaringMessageTemplates_006()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/NOTES b/ATS/core_language/15_templates/1502_declaring_signature_templates/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..fca9d61284edaea1bb417652cd59d40f544454a3 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/NOTES @@ -0,0 +1,2 @@ +The semantic tests in this section require the execution of the control scripts, +which launch the remote procedure server and client operations. \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_001.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61b99eb4db272a501171893460160c52755de399 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_001.ttcn @@ -0,0 +1,117 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.2, Test in-line templates for accepting procedure replies. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1502_DeclaringSignatureTemplates_001 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_1502_DeclaringSignatureTemplates_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_1502_DeclaringSignatureTemplates_001 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_1502_DeclaringSignatureTemplates_001 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_1502_DeclaringSignatureTemplates_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_1502_DeclaringSignatureTemplates_001; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_1502_DeclaringSignatureTemplates_001:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_001:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_001:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_001:s_returnTemplate value 1) { //check that procedure is returning correct values + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_1502_DeclaringSignatureTemplates_001 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_1502_DeclaringSignatureTemplates_001:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_1502_DeclaringSignatureTemplates_001:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + } + + + testcase TC_Sem_1502_DeclaringSignatureTemplates_001() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1502_DeclaringSignatureTemplates_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_002.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f4c8f90d73b9ac22a8e9894fe401bbd8f76d582 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_002.ttcn @@ -0,0 +1,115 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.2, Test in-line templates for accepting procedure replies. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1502_DeclaringSignatureTemplates_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return can return value any value + */ + signature p_Sem_1502_DeclaringSignatureTemplates_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_1502_DeclaringSignatureTemplates_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_1502_DeclaringSignatureTemplates_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_1502_DeclaringSignatureTemplates_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_1502_DeclaringSignatureTemplates_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_1502_DeclaringSignatureTemplates_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_002:s_wrongTemplate value ?) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_002:s_returnTemplate value ?) { //check that procedure is returning correct values + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_1502_DeclaringSignatureTemplates_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_1502_DeclaringSignatureTemplates_002:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_1502_DeclaringSignatureTemplates_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_1502_DeclaringSignatureTemplates_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1502_DeclaringSignatureTemplates_002()); + } + +} diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_003.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b2024759d2860e03f69477d4c0b72c444eff3d7 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Sem_1502_DeclaringSignatureTemplates_003.ttcn @@ -0,0 +1,112 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.2, Test in-line templates for accepting procedure replies. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1502_DeclaringSignatureTemplates_003 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return can return value any value + */ + signature p_Sem_1502_DeclaringSignatureTemplates_003(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_1502_DeclaringSignatureTemplates_003 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_1502_DeclaringSignatureTemplates_003 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_1502_DeclaringSignatureTemplates_003 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_1502_DeclaringSignatureTemplates_003; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_1502_DeclaringSignatureTemplates_003:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_1502_DeclaringSignatureTemplates_003:?) { //any reply is accepted + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_1502_DeclaringSignatureTemplates_003 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_1502_DeclaringSignatureTemplates_003:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_1502_DeclaringSignatureTemplates_003:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_1502_DeclaringSignatureTemplates_003() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_1502_DeclaringSignatureTemplates_003()); + } + +} diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_001.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e2a050c5beb6439f9e2a693a587b8e080647cab --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_001.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.2, Ensure that signature templates with explicit values are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1502_DeclaringSignatureTemplates_001 { + + signature p_Syn_1502_DeclaringSignatureTemplates_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Syn_1502_DeclaringSignatureTemplates_001 s_myTemplate := { + p_par1 := 1, + p_par2 := 2, + p_par3 := 3 + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_002.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..518ff38099c0277be0c07d89a34e4dbc116341e1 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_002.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.2, Ensure that signature templates with wildcards are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1502_DeclaringSignatureTemplates_002 { + + signature p_Syn_1502_DeclaringSignatureTemplates_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Syn_1502_DeclaringSignatureTemplates_002 s_myTemplate := { + p_par1 := 1, + p_par2 := ?, + p_par3 := ? + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_003.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7658f727101e18ae4849e82849b502187d0117d --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_003.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.2, Ensure that the basic operations call and getreply are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1502_DeclaringSignatureTemplates_003 { + + type port MyProcedurePortType procedure { + inout p_Syn_1502_DeclaringSignatureTemplates_003; + } + + type component GeneralComp { + port MyProcedurePortType pt_myPort; + } + + signature p_Syn_1502_DeclaringSignatureTemplates_003(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Syn_1502_DeclaringSignatureTemplates_003 m_myTemplate := { + p_par1 := 1, + p_par2 := 2, + p_par3 := 3 + } + + template p_Syn_1502_DeclaringSignatureTemplates_003 mw_myTemplate := { + p_par1 := 1, + p_par2 := ?, + p_par3 := ? + } + + testcase TC_Syn_1502_DeclaringSignatureTemplates_003() runs on GeneralComp { + pt_myPort.call(p_Syn_1502_DeclaringSignatureTemplates_003:m_myTemplate, nowait); + pt_myPort.getreply(p_Syn_1502_DeclaringSignatureTemplates_003:m_myTemplate); + setverdict(pass); + } + + control{ + execute(TC_Syn_1502_DeclaringSignatureTemplates_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_004.ttcn b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b143c1d1ae4acd10716d432e925962d5e7abb6c9 --- /dev/null +++ b/ATS/core_language/15_templates/1502_declaring_signature_templates/Syn_1502_DeclaringSignatureTemplates_004.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.2, Ensure that the raise and catch operations are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1502_DeclaringSignatureTemplates_004 { + + type port MyProcedurePortType procedure { + inout p_Syn_1502_DeclaringSignatureTemplates_004; + } + + type component GeneralComp { + port MyProcedurePortType pt_myPort; + } + + signature p_Syn_1502_DeclaringSignatureTemplates_004(in integer p_par1, out integer p_par2, inout integer p_par3) return integer exception (integer); + + template p_Syn_1502_DeclaringSignatureTemplates_004 m_myTemplate := { + p_par1 := 1, + p_par2 := 2, + p_par3 := 3 + } + + template p_Syn_1502_DeclaringSignatureTemplates_004 mw_myTemplate := { + p_par1 := 1, + p_par2 := ?, + p_par3 := ? + } + + testcase TC_Syn_1502_DeclaringSignatureTemplates_004() runs on GeneralComp { + pt_myPort.raise(p_Syn_1502_DeclaringSignatureTemplates_004, integer:5); + pt_myPort.catch(p_Syn_1502_DeclaringSignatureTemplates_004, integer:5); + setverdict(pass); + } + + control{ + execute(TC_Syn_1502_DeclaringSignatureTemplates_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_001.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d01e274bf1a55115a9ea33bee3b5c0934f3b0488 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_001.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error for re-assignment of a global non-parameterized template + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSem_1503_GlobalAndLocalTemplates_001 +{ + template integer t := ?; + type component GeneralComp { + } + testcase TC_NegSem_1503_GlobalAndLocalTemplates_001() runs on GeneralComp { + t := 2; // error expected + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_002.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e641e9dc5cc3015d3796eb3caebc76124b4cd8ef --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_002.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error for re-assignment of a global non-parameterized template + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSem_1503_GlobalAndLocalTemplates_002 +{ + type component GeneralComp { + } + testcase TC_NegSem_1503_GlobalAndLocalTemplates_002() runs on GeneralComp { + template integer t := ?; + t := 2; // error expected + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_003.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54948b49d3e359b9449b100632e25429c265d7be --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_003.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error for re-assignment of a global parameterized template + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSem_1503_GlobalAndLocalTemplates_003 +{ + template integer t(in integer p) := (0..p); + type component GeneralComp { + } + testcase TC_NegSem_1503_GlobalAndLocalTemplates_003() runs on GeneralComp { + t := 2; // error expected + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_004.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7d1a0e8dee92c4dbf517291f9f75f3be7df5dc5 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSem_1503_GlobalAndLocalTemplates_004.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error for re-assignment of a local parameterized template + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSem_1503_GlobalAndLocalTemplates_004 +{ + type component GeneralComp { + } + testcase TC_NegSem_1503_GlobalAndLocalTemplates_004() runs on GeneralComp { + template integer t(in integer p) := (0..p); + t := 2; // error expected + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_001.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9af7526917e7ede7c64f0195854a924ca3e14ae1 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_001.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error if no value is assigned in a global non-parameterized template declaration + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSyn_1503_GlobalAndLocalTemplates_001 +{ + template integer t; +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_002.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b73a3965f4c9b03604c78aeaa988f2e62809a5e9 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_002.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error if no value is assigned in a local non-parameterized template declaration + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSyn_1503_GlobalAndLocalTemplates_002 +{ + type component GeneralComp { + } + testcase TC_NegSyn_1503_GlobalAndLocalTemplates_002() runs on GeneralComp { + template integer t; + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_003.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8b6332659da41db12bca047b75c47efc471d6c8 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_003.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error if no value is assigned in a global parameterized template declaration + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSyn_1503_GlobalAndLocalTemplates_003 +{ + template integer t(in integer p); +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_004.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c3d91a9444d180d5b7f29ec047f55c229cc0d8e --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/NegSyn_1503_GlobalAndLocalTemplates_004.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that there's an error if no value is assigned in a local parameterized template declaration + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Both global and local templates are initialized at the place of their +// declaration. This means, all template fields which are not affected by +// parameterization shall receive a value or matching mechanism. Template +// fields affected by parameterization are initialized at the time of +// template use. +module NegSyn_1503_GlobalAndLocalTemplates_004 +{ + type component GeneralComp { + } + testcase TC_NegSyn_1503_GlobalAndLocalTemplates_004() runs on GeneralComp { + template integer t(in integer p); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_001.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22da0c25d4e1142a8f9aa161f558f41d6e4c3ff2 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_001.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a template values can be accessed with the dot notation as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_001 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_myTemplate := { + field1 := 2, + field2 := "foobar", + field3 := true +} + +testcase TC_Sem_1503_GlobalAndLocalTemplates_001() runs on GeneralComp { + if (match(2,m_myTemplate.field1) and match("foobar", m_myTemplate.field2) and match(true, m_myTemplate.field3)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_001()); +} +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_002.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f06f95b7a4181b81208d0d612c684c5f6aaa038e --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_002.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a template actual parameter is passed through correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_002 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true +} + +testcase TC_Sem_1503_GlobalAndLocalTemplates_002() runs on GeneralComp { + if (valueof(m_myTemplate(2).field1) == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_002()); +} +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_003.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9de5cffb8edf29bcc3c06be6daaf676a75d83136 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_003.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a send operation with actual parameters of a global parameterized template is accepted. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_003 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := "abcxyz", + field3 := true + } + + testcase TC_Sem_1503_GlobalAndLocalTemplates_003() runs on GeneralComp { + pt_myPort.send(m_myTemplate(2)); + setverdict(pass); + } + + control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_003()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_004.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..954710aa3b15303000b68cdab3d24655b0bc222d --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_004.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a parameterized local template in a test case is accepted. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_004 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_Sem_1503_GlobalAndLocalTemplates_004() runs on GeneralComp { + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := "abcxyz", + field3 := true + } + + pt_myPort.send(m_myTemplate(2)); + setverdict(pass); + } + + control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_004()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_005.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..799af30ff3b343e1bc3ecc8dc28820b54223e7a5 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a send operation with actual parameters of a global parameterized template is accepted with the actual parameter being a template parameter. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_005 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + MyMessageType field3 optional + } + + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := "abc1xyz", + field3 := omit + } + + template MyMessageType m_myOtherTemplate(template MyMessageType p_myTemplate):= { + field1 := 2, + field2 := "abcxyz", + field3 := p_myTemplate + } + + testcase TC_Sem_1503_GlobalAndLocalTemplates_005() runs on GeneralComp { + pt_myPort.send(m_myOtherTemplate(m_myTemplate(2))); + setverdict(pass); + } + + control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_005()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_006.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cf8610cd46584298e049a0d2ffabe67eba64084 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Sem_1503_GlobalAndLocalTemplates_006.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a send operation with actual parameters of a global parameterized template is accepted with the actual parameter being an inline template. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1503_GlobalAndLocalTemplates_006 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + MyMessageType field3 optional + } + + template MyMessageType m_myOtherTemplate(template MyMessageType p_myTemplate):= { + field1 := 2, + field2 := "abcxyz", + field3 := p_myTemplate + } + + testcase TC_Sem_1503_GlobalAndLocalTemplates_006() runs on GeneralComp { + pt_myPort.send(m_myOtherTemplate(MyMessageType:{2,"foobar",omit})); + setverdict(pass); + } + + control{ + execute(TC_Sem_1503_GlobalAndLocalTemplates_006()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_001.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28a4cf1d6ca1ac4c5ed9f6cc7b9d6d2a92d7a625 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_001.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a global parameterized template is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1503_GlobalAndLocalTemplates_001 { + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_004.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ce556b59ab02297fa4ce6eded2937b28607c2f7 --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_004.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a parameterized local template in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1503_GlobalAndLocalTemplates_004 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + control{ + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true + } + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_005.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d97f0bad4d3a81a3ac6517aa7cc52d564af40df --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a parameterized local template in a function is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1503_GlobalAndLocalTemplates_005 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + function f_testTemplate() { + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_006.ttcn b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e4704f429b827e5032ddfa56683ada7ab1bf53f --- /dev/null +++ b/ATS/core_language/15_templates/1503_global_and_local_templates/Syn_1503_GlobalAndLocalTemplates_006.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.3, Ensure that a parameterized local template in an altstep is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1503_GlobalAndLocalTemplates_006 { + + type port MyMessagePortType message { + inout MyMessageType + } + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + altstep f_testTemplate() runs on GeneralComp { + [] pt_myPort.receive { + template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true + } + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_001.ttcn b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9851e00303cb856577f9797181bff64c9fdf96c --- /dev/null +++ b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.4, Ensure that inline templates are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1504_InlineTemplates_001 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +testcase TC_Syn_1504_InlineTemplates_001() runs on GeneralComp { + pt_myPort.send(MyMessageType:{2, "abcxyz", true}); + setverdict(pass); +} + +control{ + execute(TC_Syn_1504_InlineTemplates_001()); +} +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_002.ttcn b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d9d6b6e56fc69a414007f723604f68e1238839c --- /dev/null +++ b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.4, Ensure that modified parameterized inline templates are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1504_InlineTemplates_002 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_myTemplate(integer p_myFormalParam):= { + field1 := p_myFormalParam, + field2 := pattern "abc*xyz", + field3 := true +} + +testcase TC_Syn_1504_InlineTemplates_002() runs on GeneralComp { + pt_myPort.send(MyMessageType:modifies m_myTemplate(2) := {field2:="foobar"}); + setverdict(pass); +} + +control{ + execute(TC_Syn_1504_InlineTemplates_002()); +} +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_003.ttcn b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b197d98b9cec7e3451aefb8ddf1c896f7710b01b --- /dev/null +++ b/ATS/core_language/15_templates/1504_inline_templates/Syn_1504_InlineTemplates_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.4, Ensure that modified plain inline templates are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1504_InlineTemplates_003 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_myTemplate := { + field1 := 2, + field2 := pattern "abc*xyz", + field3 := true +} + +testcase TC_Syn_1504_InlineTemplates_003() runs on GeneralComp { + pt_myPort.send(MyMessageType:modifies m_myTemplate := {field2:="foobar"}); + setverdict(pass); +} + +control{ + execute(TC_Syn_1504_InlineTemplates_003()); +} +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_001.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de7a3acca62c6fc5b5c4bfaef5d0ced007bf5dcd --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_001.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that a modified template does not refer to itself. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_001 { + +type record of integer MyMessageType; + +template MyMessageType m_myBaseTemplate := { 0, 1, 2, 3, 4 }; + +template MyMessageType m_myOtherTemplate modifies m_myOtherTemplate := { + [2]:=3, // switch the positions of 2 and 3 + [3]:=2 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_002.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68bc29e671c25b26317c80534e8f550697ec9be1 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that a modified template does not omit possible parameters of the base template. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_002 { + +type record of integer MyMessageType; + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_value) := { + field1 := p_value, + field2 := "Hello World", + field3 := true +} + +// illegal definition as the (integer p_value) formal parameter is missing and must +// not be omitted. +template MyMessageType m_templateTwo modifies m_templateOne := { + field3 := false +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_003.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acca3a7ff102e45726c7757cbdbd37439a558dc3 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that a modified template does not omit possible parameters introduced in any modification step. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_003 { + +type record of integer MyMessageType; + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue, boolean p_boolValue) modifies m_templateOne := { + field1 := p_intValue, + field3 := p_boolValue +} + +// illegal as it is missing the (boolean p_boolValue) formal parameter introduced in the previous +// modification step. +template MyMessageType m_templateThree(integer p_intValue) modifies m_templateTwo := { + field2 := "foobar" +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_004.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a385e893084693b05725d97f4e3be0ac79cc7599 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_004.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that parameter names in modified templates are the same. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_004 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_value) := { + field1 := p_value, + field2 := "Hello World", + field3 := true +} + +// illegal as p_intValue is a different parameter name than p_value +template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateOne := { + field3 := false +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_005.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a062164649dec1c2ce4a8c9e4de61283a61ed83 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_005.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the dash in default parameter values of a modified templates is only accepted when the base template actually has a default value. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_005 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +// illegal as p_intValue does not have a default value that can be referred to with the "-". +template MyMessageType m_templateTwo(integer p_intValue := -) modifies m_templateOne := { + field1 := p_intValue +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_006.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04249615c77f7d8def33a838bcf45c9c79c7fed4 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_006.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the same parameter name is used when modifying the base template. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_006 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +// illegal as parameter name mismatch p_intValue defined in m_templateOne +template MyMessageType m_templateTwo(integer p_value := -) modifies m_templateOne := { + field1 := p_value +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_007.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccae79fda9c16f0810871be176e5afe8f0094ec4 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSem_1505_ModifiedTemplates_007.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the same parameter type is used when modifying the base template. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1505_ModifiedTemplates_007 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +// illegal as parameter type mismatch boolean defined in m_templateOne +template MyMessageType m_templateTwo(boolean p_intValue) modifies m_templateOne := { + field1 := 5 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/NegSyn_1505_ModifiedTemplates_001.ttcn b/ATS/core_language/15_templates/1505_modified_templates/NegSyn_1505_ModifiedTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab94c5ab4d4851fab32f0b534499ae680b944bdd --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/NegSyn_1505_ModifiedTemplates_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the base tamplate and modified template cannot be the same + ** @verdict pass reject, noexectuion + *****************************************************************/ +//Restriction a) +/*A modified template shall not refer to itself, either directly or indirectly, i.e. recursive derivation is not +allowed.*/ + +module NegSyn_1505_ModifiedTemplates_001{ + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateOne := { + field1 := 5 +} + +//error: not allowed to modify itself +template MyMessageType m_templateTwo(integer p_intValue) modifies m_templateTwo := { + field1 := 10 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_001.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50896181eaad74dc0ed56a00a159afacf2aeba1e --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_001.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the values of plain modified template definitions are as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1505_ModifiedTemplates_001 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne := { + field1 := 2, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo modifies m_templateOne := { + field1 := 4 +} + +testcase TC_Sem_1505_ModifiedTemplates_001() runs on GeneralComp { + if (match(valueof(m_templateTwo.field1), 4) and + match(valueof(m_templateTwo.field2), "Hello World") and + match(valueof(m_templateTwo.field3), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_002.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5a8cdc8360c11192f68e259e207a18b45b18d0c --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that a modified template of a record of type using index notation access works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1505_ModifiedTemplates_002 { + +type component GeneralComp { +} + +type record of integer MyMessageType; + +template MyMessageType m_myBaseTemplate := { 0, 1, 2, 3, 4 }; + +template MyMessageType m_myOtherTemplate modifies m_myBaseTemplate := { + [2]:=3, // switch the positions of 2 and 3 + [3]:=2 +} + +testcase TC_Sem_1505_ModifiedTemplates_002() runs on GeneralComp { + if (match(valueof(m_myOtherTemplate[0]), 0) and + match(valueof(m_myOtherTemplate[1]), 1) and + match(valueof(m_myOtherTemplate[2]), 3) and + match(valueof(m_myOtherTemplate[3]), 2) and + match(valueof(m_myOtherTemplate[4]), 4) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_003.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31e42ef77a6f7d2fa60ca2cc95926cd2f955db19 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_003.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1505_ModifiedTemplates_003 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue:=2, boolean p_boolValue:=false) modifies m_templateOne := { + field1 := p_intValue, + field3 := p_boolValue +} + +testcase TC_Sem_1505_ModifiedTemplates_003() runs on GeneralComp { + if (match(valueof(m_templateTwo.field1), 2) and + match(valueof(m_templateTwo.field2), "Hello World") and + match(valueof(m_templateTwo.field3), false) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_004.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7c2f1c3a4f2ae7e221ba163de99f046f59affe2 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_004.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected when the modified template uses the dash for the default value. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1505_ModifiedTemplates_004 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue:=2) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue := -) modifies m_templateOne := { + field1 := p_intValue +} + +testcase TC_Sem_1505_ModifiedTemplates_004() runs on GeneralComp { + if (match(valueof(m_templateTwo.field1), 2) and + match(valueof(m_templateTwo.field2), "Hello World") and + match(valueof(m_templateTwo.field3), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_005.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b98a804075c9cde368958576c293404cbea65783 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_005.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + //Restriction a) +/*In case of templates, template fields or list elements of simple types, union and enumerated types, the +matching mechanism specified in the modified template is simply replacing its corresponding content in its +parent.*/ + +module Sem_1505_ModifiedTemplates_005 { + +type component GeneralComp { } + +type union MyMessageType { + integer field +} + +template MyMessageType m_templateOne := { //union type + field :=2 +} + +template MyMessageType m_templateTwo(integer p_intValue := 10) modifies m_templateOne := { + field := p_intValue +} + +testcase TC_Sem_1505_ModifiedTemplates_005() runs on GeneralComp { + if (match(valueof(m_templateTwo.field) , 10) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_005()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_006.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d68602575e05b9e54573f958faf47d6909c9a37 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_006.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Restriction a) +/*In case of templates, template fields or list elements of simple types, union and enumerated types, the +matching mechanism specified in the modified template is simply replacing its corresponding content in its +parent.*/ + +module Sem_1505_ModifiedTemplates_006 { + +type component GeneralComp { } + + +type enumerated MyEnum { + A,B,C +} + +type record MyMessageType { + integer field1, + MyEnum field2 +} + +template MyMessageType m_templateOne := { + field1 :=10, + field2 := A //enum type +} + +template MyMessageType m_templateTwo(MyEnum p_intValue := B) modifies m_templateOne := { + field2 := p_intValue +} + +testcase TC_Sem_1505_ModifiedTemplates_006() runs on GeneralComp { + if (match(valueof(m_templateTwo.field2) , B) and match(valueof(m_templateTwo.field1) , 10)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_007.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..614b1989fdb4b73cee2155aec5b3676464de679d --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_007.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + //Restriction b) + +/*If a record or set field or its corresponding matching mechanism is – implicitly or explicitly by using the not used symbol "-" - +left unspecified in the modified template, then the matching mechanism in the corresponding field of the +parent template shall be used.*/ + +module Sem_1505_ModifiedTemplates_007 { + +type component GeneralComp { } + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue:=2, boolean p_boolValue:=false) modifies m_templateOne := { + field1 := p_intValue, + field2 := -, //not used symbol + field3 := p_boolValue +} + +testcase TC_Sem_1505_ModifiedTemplates_007() runs on GeneralComp { + if (match(valueof(m_templateTwo.field1) , 2) and + match(valueof(m_templateTwo.field2) , "Hello World") and + match(valueof(m_templateTwo.field3) , false) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_007()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bb0aab1a2951d41ee8f749603056c41cd81ee32 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_008.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the values of plain modified template definitions are as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/*A modified template may also be declared fuzzy using the @fuzzy modifier. +If a fuzzy modified template modifies a non-fuzzy unparameterized template, the inherited fields before modification will be the same for every evaluation of the fuzzy template.*/ + +module Sem_1505_ModifiedTemplates_008 { + +type port MyMessagePortType message { + inout MyMessageType +} + +type component GeneralComp { + port MyMessagePortType pt_myPort; +} + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne := { + field1 := 2, + field2 := "Hello World", + field3 := - +} + +template @fuzzy MyMessageType m_templateTwo modifies m_templateOne := { + field1 := 4, + field3 := true +} + +testcase TC_Sem_1505_ModifiedTemplates_008() runs on GeneralComp { + if ((valueof(m_templateTwo.field1) == 4) and + (valueof(m_templateTwo.field2) == "Hello World") and + (valueof(m_templateTwo.field3) == true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_008()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_009.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..257be20713dfb81e265ef49bb0e9a8ccab9470fb --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_009.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +//Restriction c) +/*For templates, template fields and elements of record of and set of types, the above rules specified for +records and sets apply with the following deviations: + * if the value list notation is used, only the number of elements listed in the modified template is inherited +from the parent (i.e. the list is truncated at the last element of the list notation in the modified template)*/ + +module Sem_1505_ModifiedTemplates_009 { + +type component GeneralComp { } + +type record of charstring MyMessageType; + +template MyMessageType m_templateOne := {"A","AB", "ABC", "ABCD","ABCDE","ABCDEF"}; + + +template MyMessageType m_templateTwo modifies m_templateOne := { "-", "AB", "ABC"} //after 3rd element no more elements are inherited from the parent + +testcase TC_Sem_1505_ModifiedTemplates_009() runs on GeneralComp { + if (match(valueof(m_templateTwo),{"-", "AB", "ABC"})) + { + setverdict(pass,m_templateTwo); + } else { + setverdict(fail,m_templateTwo); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_009()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_010.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4e58ad6b2e694f027be1ca39f4e04ce91bffc86 --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Sem_1505_ModifiedTemplates_010.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that default values in formal parameters of modified templates are working as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +//Restriction c) +/*For templates, template fields and elements of record of and set of types, the above rules specified for +records and sets apply with the following deviations: + * if the value list notation is used, only the number of elements listed in the modified template is inherited +from the parent (i.e. the list is truncated at the last element of the list notation in the modified template)*/ +module Sem_1505_ModifiedTemplates_010 { + +type component GeneralComp { } + +type set of integer MyMessageType; + +template MyMessageType m_templateOne := {1,2,3,4,5,6,7,8,9,10}; + + +template MyMessageType m_templateTwo modifies m_templateOne := {2,2,3} //after 3rd element no more elements are inherited from the parent + modification on the first element + +testcase TC_Sem_1505_ModifiedTemplates_010() runs on GeneralComp { + if (match(valueof(m_templateTwo),{2,2,3})) + { + setverdict(pass,m_templateTwo); + } else { + setverdict(fail,m_templateTwo); + } +} + +control{ + execute(TC_Sem_1505_ModifiedTemplates_010()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_001.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bda3f328f34aadfd24436e702e6c8ea51aa066de --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that plain modified template definitions are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1505_ModifiedTemplates_001 { + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne := { + field1 := 2, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo modifies m_templateOne := { + field1 := 4 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_002.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24ea4c26bb4b5e57ee7fd920ec15d99140a01cbb --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that a modified template does not omit possible parameters introduced in any modification step. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1505_ModifiedTemplates_002 { + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_value) := { + field1 := p_value, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_value, boolean p_boolValue) modifies m_templateOne := { + field1 := p_value, + field3 := p_boolValue +} + +template MyMessageType m_templateThree(integer p_value, boolean p_boolValue) modifies m_templateTwo := { + field2 := "foobar" +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_003.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4e7eb5acf3def9890fafddcdfdce2af9daa0d4b --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_003.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that the default values in formal parameters of modified templates are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1505_ModifiedTemplates_003 { + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue:=2, boolean p_boolValue:=false) modifies m_templateOne := { + field1 := p_intValue, + field3 := p_boolValue +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_004.ttcn b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..680244205aa8b8884095df09d9fa2b63862892db --- /dev/null +++ b/ATS/core_language/15_templates/1505_modified_templates/Syn_1505_ModifiedTemplates_004.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.5, Ensure that dash as default parameter values are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1505_ModifiedTemplates_004 { + +type record MyMessageType { + integer field1, + charstring field2, + boolean field3 +} + +template MyMessageType m_templateOne(integer p_intValue:=2) := { + field1 := p_intValue, + field2 := "Hello World", + field3 := true +} + +template MyMessageType m_templateTwo(integer p_intValue := -) modifies m_templateOne := { + field1 := p_intValue +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150601_referencing_individual_string_elements/NegSem_150601_ReferencingIndividualStringElements_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150601_referencing_individual_string_elements/NegSem_150601_ReferencingIndividualStringElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b83279ffd6ccc1e85a928c032e00a1314ab4ad0 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150601_referencing_individual_string_elements/NegSem_150601_ReferencingIndividualStringElements_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.1, Ensure that the referencing of individual string elements inside templates or template fields is forbidden. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150601_ReferencingIndividualStringElements_001 { + +type component GeneralComp { } + +testcase TC_NegSem_150601_ReferencingIndividualStringElements_001() runs on GeneralComp { + var template charstring m_char1 := "MYCHAR1"; + var template charstring m_char2; + + // illegal acchess. Instead, substr should be used. + m_char2 := m_char1[1]; + + if (m_char2 == "Y") { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_150601_ReferencingIndividualStringElements_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc9ecae5ecfbccfaf363d5998a8a47ea8ee6def8 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that fields with omit values on the right-hand side of an assignment are rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150602_ReferencingRecordAndSetFields_001 { + +type component GeneralComp { } + +type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional +} + +type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_001() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := 5, + f2 := omit + } + + // shall cause an error as omit is assigned to m_R1.f2 + var template MyRecordOne m_R2 := m_R1.f2.g2; + // if we get here, something must be wrong + setverdict(fail); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_001()); +} + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d4b68a2447fa037d6cbe28fe09e5611d7cb599b --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_002.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that fields with * values on the right-hand side of an assignment are rejected + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150602_ReferencingRecordAndSetFields_002 { + +type component GeneralComp { } + +type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional +} + +type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_002() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := 5, + f2 := omit + } + + m_R1.f2 := *; + + // shall cause an error as * is assigned to m_R1.f2 + var template MyRecordTwo m_R2 := m_R1.f2.g2; + // if we get here, something must be wrong + setverdict(fail); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_002()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fc7d9b5b50baea750cdbc54e3616ef736c96ab0 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_003.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that value lists on the right-hand side of an assignment are not acceped. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150602_ReferencingRecordAndSetFields_003 { + +type component GeneralComp { } + +type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional +} + +type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_003() runs on GeneralComp { + var template MyRecordOne m_R1 := ( + { + f1 := omit, + f2 := + { + g1 := 0, + g2 := omit + } + }, + { + f1 := 5, + f2 := + { + g1 := 1, + g2 := + { + g1 := 2, + g2 := omit + } + } + } + ); + + // shall cause an error as value list is assigned to m_R1 + var template MyRecordTwo m_R2 := m_R1.f2; + m_R2 := m_R1.f2.g2; + m_R2 := m_R1.f2.g2.g2; + // if we get here, something must be wrong + setverdict(fail); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_003()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3bd20ae816fa2141e6a0b6172b8f61a57f962f71 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_004.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that complement lists on the right-hand side of an assignment are not acceped. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150602_ReferencingRecordAndSetFields_004 { + +type component GeneralComp { } + +type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional +} + +type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_004() runs on GeneralComp { + var template MyRecordOne m_R1 := complement( + { + f1 := omit, + f2 := + { + g1 := 0, + g2 := omit + } + }, + { + f1 := 5, + f2 := + { + g1 := 1, + g2 := + { + g1 := 2, + g2 := omit + } + } + } + ); + + // shall cause an error as a complement list is assigned to m_R1 + var template MyRecordTwo m_R2 := m_R1.f2; + m_R2 := m_R1.f2.g2; + m_R2 := m_R1.f2.g2.g2; + // if we get here, something must be wrong + setverdict(fail); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_004()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_005.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5da2efafd6f23a8e10b902b4cb3f9be3353f875d --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that referencing a template field with the ifpresent attribute causes a rejection. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150602_ReferencingRecordAndSetFields_005 { + +type component GeneralComp { } + +type record MyRecordOne { + MyRecordOne f1 optional +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_005() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := * ifpresent + } + var template MyRecordOne m_R2 := { + f1 := m_R1.f1.f1 // access to a field with ifpresent shall cause an error! + } + setverdict(fail); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_005()); +} + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_006.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c11f8cd6764946c8563e6fd778c0492420cf151 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/NegSem_150602_ReferencingRecordAndSetFields_006.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that referencing a field of an address type, which actual value is null shall cause rejection. + ** @verdict pass reject + *****************************************************************/ + +//Restriction d) +/*Special value null: referencing a field of an address type, which actual value is null shall cause an error.*/ + +module NegSem_150602_ReferencingRecordAndSetFields_006 { + +type component GeneralComp { } + +type integer address; + +type record MyRecordOne { + address f1 +} + +testcase TC_NegSem_150602_ReferencingRecordAndSetFields_006() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := null + } + var template MyRecordOne m_R2 := { + f1 := m_R1.f1.f1 // access to a field with null shall cause an error! + } + setverdict(pass); +} + +control{ + execute(TC_NegSem_150602_ReferencingRecordAndSetFields_006()); +} + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..950a297dbd116a14c19d18831cce31a2ddc19de0 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_001.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.6.2, ? shall be returned for mandatory subfields and * shall be returned for optional subfields. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150602_ReferencingRecordAndSetFields_001 { + + type component GeneralComp { } + + type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional + } + + type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional + } + + testcase TC_Sem_150602_ReferencingRecordAndSetFields_001() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := 0, + f2 := ? + } + + // m_R2.g1 is mandatory, therefore it shall be ? + // m_R2.g2 is optional, therefore it shall be * + var template MyRecordTwo m_R2 := m_R1.f2; + + var template(value) MyRecordTwo m_value := { + g1 := 5, + g2 := omit + } + + // match against ? + var boolean v_matchRes1 := match(5, m_R2.g1); + + + if (v_matchRes1) { + setverdict(pass); + } else { + setverdict(fail, "match against ?"); + } + + } + + control{ + execute(TC_Sem_150602_ReferencingRecordAndSetFields_001()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd298ceb89f431cdedab1f447cf763205340fd44 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_002.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.2, Ensure that the recurisve anyvalue expansion is performed correctly when new values are assigned. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150602_ReferencingRecordAndSetFields_002 { + +type component GeneralComp { } + +type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional +} + +type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional +} + +testcase TC_Sem_150602_ReferencingRecordAndSetFields_002() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := 0, + f2 := ? + } + + m_R1.f2.g2.g2 := {g1:=1, g2:=omit}; + // as f2 is ? and we access g2.g2, TTCN-3 should expand the following fields to + // contain the following values: + // m_R1.f1 = 0 + // m_R1.f2 = { + // g1 = ? + // g2 = { + // g1 = ?, + // g2 = { + // g1 = 1 + // g2 = omit + // } + // } + // } + + if (match(valueof(m_R1.f1), 0) and + ispresent(m_R1.f2.g2) and + ispresent(m_R1.f2.g2.g2) and + ( ispresent(m_R1.f2.g2.g2.g2) == false) and + match( valueof(m_R1.f2.g2.g2.g1), 1 ) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_150602_ReferencingRecordAndSetFields_002()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..155c389640aba1fb37ee8b8db15df7a9478f5b20 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_003.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.6.2, ? shall be returned for mandatory subfields and * shall be returned for optional subfields. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150602_ReferencingRecordAndSetFields_003 { + + type component GeneralComp { } + + type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional + } + + type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional + } + + testcase TC_Sem_150602_ReferencingRecordAndSetFields_003() runs on GeneralComp { + var boolean v_matchRes; + var template MyRecordOne m_R1 := { + f1 := 0, + f2 := ? + } + + // m_R2.g1 is mandatory, therefore it shall be ? + // m_R2.g2 is optional, therefore it shall be * + var template MyRecordTwo m_R2 := m_R1.f2; + var MyRecordTwo m_value := { + g1 := 5, + g2 := omit + } + + // match against {?, *} + v_matchRes := match(m_value, MyRecordTwo:{m_R2.g1, m_R2.g2}); + + + if (v_matchRes) { + setverdict(pass); + } else { + setverdict(fail, "match against {?, *}"); + } + + } + + control{ + execute(TC_Sem_150602_ReferencingRecordAndSetFields_003()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d152aaeb9f491a5c36969903749c85ee4217a8d6 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150602_referencing_record_and_set_fields/Sem_150602_ReferencingRecordAndSetFields_004.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.6.2, ? shall be returned for mandatory subfields and * shall be returned for optional subfields. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150602_ReferencingRecordAndSetFields_004 { + + type component GeneralComp { } + + type record MyRecordTwo { + integer g1, + MyRecordTwo g2 optional + } + + type record MyRecordOne { + integer f1 optional, + MyRecordTwo f2 optional + } + + testcase TC_Sem_150602_ReferencingRecordAndSetFields_004() runs on GeneralComp { + var template MyRecordOne m_R1 := { + f1 := 0, + f2 := ? + } + + // m_R2.g1 is mandatory, therefore it shall be ? + // m_R2.g2 is optional, therefore it shall be * + var template MyRecordTwo m_R2 := m_R1.f2; + + var MyRecordTwo m_value := { + g1 := 5, + g2 := omit + } + + // match against {?, *} - use dotted notation to cover other expansion thread + var boolean v_matchRes := match(m_value, MyRecordTwo:{m_R1.f2.g1, m_R1.f2.g2}); + + + if (v_matchRes) { + setverdict(pass); + } else { + setverdict(fail, "match against {?, *} - use dotted notation to cover other expansion thread"); + } + } + + control{ + execute(TC_Sem_150602_ReferencingRecordAndSetFields_004()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef52885a3d0522ddc0eae2eb366af115f4b48e8c --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing an element within a value list causes an error in the context of record of. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_001 { + + type component GeneralComp { } + + type record of integer RoI; + type record of RoI RoRoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_001() runs on GeneralComp { + var template RoI m_one; + var template RoRoI m_two; + template RoRoI constraint_value := {{},{0},{0,0},{0,0,0}}; + + m_two := ( constraint_value, constraint_value ); // value list + m_one := m_two[0]; // shall cause an error as we access a value list + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f4a8208c607ecb9a39b46e59dbc46502d4b9ee4 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_002.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that access to unitialized fields in the context of record of is rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_002 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_002() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one[0] := 0; + m_one[2] := 1; + v_test := valueof(m_one[1]); // shall cause an error as element one is an unitialized field + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_002()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52c0857e9b59cba4112a56eccf9c9e212aae59d2 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_003.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that anyvalueornone fields in the context of record of is rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_003 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_003() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {0,*,1,2}; + v_test := valueof(m_one[1]); // shall cause an error as element one is an "any value or none" field + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_003()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..931554fae5733f59391668d6994ba5d8660c35fa --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that complement value lists in the context of record of are rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_004 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_004() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {0,complement(1,3,5),1,2}; + v_test := valueof(m_one[1]); // shall cause an error as element one is a complement list + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_005.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bce2ed3ceae8d1ee011926063d988395fd961b55 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_005.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that subset in the context of record of are rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_005 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_005() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {0,subset(1,3,5),1,2}; + v_test := valueof(m_one[1]); // shall cause an error as element one is a subset + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_005()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_006.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..433910f37fd75fdc9ff378bcdb3ddcdd4083edee --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_006.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that superset in the context of record of are rejected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_006 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_006() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {0,superset(1,3,5),1,2}; + v_test := valueof(m_one[1]); // shall cause an error as element one is a superset + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_006()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_007.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b50ce2f2c7898b0ff5fd5a09f8576512884809da --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_007.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that access into permutation in record of templates is forbidden. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_007 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_007() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {permutation(0,1,3,?),2,*}; + v_test := valueof(m_one[2]); // shall cause an error as the third element (index 2) will be inside the permutation + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_007()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_008.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..537e6ce135b5a026878c21b388b2062236d05abc --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_008.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that access to record of indexes is forbidden when a previous index entry is a permutation with a *. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_008 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_008() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {permutation(0,1,3,*),2,?}; + v_test := valueof(m_one[5]); // shall cause an error as the permutation contains a * that is able to cover any record of indexes + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_009.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7c032b7ef366c86b6e5c5183d336e4c46ce37a7 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_009.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that access to ifpresent fields is not allowed. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_009 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_009() runs on GeneralComp { + var template RoI m_one; + var integer v_test; + + m_one := {1 ifpresent,2,?}; + v_test := valueof(m_one[0]); // shall cause an error due to the presence of ifpresent + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_009()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_010.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..701a1e6198e9c8a7da1e739c81fb9da5763cb036 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_010.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing AnyValueOrNone fields is not allowed. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_010 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_010() runs on GeneralComp { + var template RoI m_one; + + m_one := ?; + m_one[2] := 2; + // assignment should yield {?,?,2,*} + + if (not match(5,m_one[0])) { + setverdict(fail); + } + if (not match(5,m_one[1])) { + setverdict(fail); + } + if (not match(2,m_one[2])) { + setverdict(fail); + } + if (not match(5,m_one[3])) { // shall cause an error due to the presence of AnyValueOrNone + setverdict(fail); + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_010()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_011.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be1a94bc36c6b7a06143c795a5a4ac6eb3330a84 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_011.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing uninitialized fields is not allowed. + ** @verdict pass reject + *****************************************************************/ + + //Restriction a) Omit: referencing an element within a record of, set of or array field to which omit is assigned shall follow the rules specified in clause 6.2.3. + + /*Clause 6.2.3: If the value of the element indicated by the index at the right-hand of an assignment is undefined (uninitialized), this +shall cause a semantic or runtime error. Referencing an identified element of an uninitialized or omitted record of or set +of field or value on the right hand side of an assignment shall cause an error.*/ + + +module NegSem_150603_ReferencingRecordOfAndSetElements_011 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_011() runs on GeneralComp { + + var template RoI m_one; + var template RoI m_two; + + m_one := {1,-}; // {1,-} + m_two := {m_one[1],4}; // {-,4} error not allowed referencing + + if (not isvalue(m_two)) { + setverdict(pass); + } + + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_011()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_012.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4c180d5dfefdc674cf12f1d21c8aab5359242980 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_012.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing uninitialized fields is not allowed. + ** @verdict pass reject + *****************************************************************/ + +//Restriction a) Omit: referencing an element within a record of, set of or array field to which omit is assigned shall follow the rules specified in clause 6.2.3. + +/*Clause 6.2.3: If the value of the element indicated by the index at the right-hand of an assignment is undefined (uninitialized), this +shall cause a semantic or runtime error. Referencing an identified element of an uninitialized or omitted record of or set +of field or value on the right hand side of an assignment shall cause an error.*/ + + +module NegSem_150603_ReferencingRecordOfAndSetElements_012{ + + type component GeneralComp { } + + type set of integer SoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_012() runs on GeneralComp { + + var template SoI m_one; + var template SoI m_two; + + m_one := {1,-}; // {1,-} + m_two := {m_one[1],2}; // {-,2} error not allowed referencing + + if (not isvalue(m_two)) { + setverdict(pass); + } + + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_012()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_013.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..add8bf0fea27e3e1cad5f705c19fd504884500b3 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_013.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing uninitialized fields is not allowed. + ** @verdict pass reject + *****************************************************************/ + +//Restriction a) Omit: referencing an element within a record of, set of or array field to which omit is assigned shall follow the rules specified in clause 6.2.3. + +/*Clause 6.2.3: If the value of the element indicated by the index at the right-hand of an assignment is undefined (uninitialized), this +shall cause a semantic or runtime error. Referencing an identified element of an uninitialized or omitted record of or set +of field or value on the right hand side of an assignment shall cause an error.*/ + + +module NegSem_150603_ReferencingRecordOfAndSetElements_013{ + + type component GeneralComp { } + + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_013() runs on GeneralComp { + + var integer m_one[2]; + var integer m_two[2]; + + m_one := {1,-}; // {1,-} + m_two := {m_one[1],2}; // {-,2} error not allowed referencing + + if (not isvalue(m_two)) { + setverdict(pass); + } + + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_013()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_014.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c8a90fb598cdcb904b1fd7ba26acfa9a5971295 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_014.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing an element within a value list causes an error in the context of set of. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_014 { + + type component GeneralComp { } + + type set of integer RoI; + type set of RoI RoRoI; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_014() runs on GeneralComp { + var template RoI m_one; + var template RoRoI m_two; + template RoRoI constraint_value := {{},{0},{0,0},{0,0,0}}; + + m_two := ( constraint_value, constraint_value ); // value list + m_one := m_two[0]; // shall cause an error as we access a value list + + setverdict(fail); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_014()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_015.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7662887a48932f9277da1eff3abf813bdc02562 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/NegSem_150603_ReferencingRecordOfAndSetElements_015.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing an element of an address type, which actual value is null shall cause an error. + ** @verdict pass reject + *****************************************************************/ + + //Restriction h) +/*Special value null: referencing an element of an address type, which actual value is null shall cause an error.*/ + +module NegSem_150603_ReferencingRecordOfAndSetElements_015 { + + type component GeneralComp { } + + type set of integer RoI; + type integer address; + + testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_015() runs on GeneralComp { + var address v_add := null; + var template RoI m_one; + + + m_one := {v_add, 1}; // // shall cause an error as we access a value list + + setverdict(pass); + } + + control{ + execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_015()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e9e5f84a5485192114aa6aa053e4cebe0c5fabb --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that assignment of an anyvalue on the right hand side yields an anyvalue in the context of record of. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150603_ReferencingRecordOfAndSetElements_001 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_001() runs on GeneralComp { + var template RoI m_one; + var template RoI m_two; + + m_one := {0,?,2}; + m_two := {0,1,2}; + m_two[1] := m_one[1]; + + if (match(5,m_two[1])) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_001()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8198379a3fe88413d1283a1af208fe930e33bf8f --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_002.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that assignment to a anyvalue in the context of record of is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150603_ReferencingRecordOfAndSetElements_002 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_002() runs on GeneralComp { + var template RoI m_one; + + m_one := ?; + m_one[2] := 2; + // assignment should yield {?,?,2,*} + + if (not match(5,m_one[0])) { + setverdict(fail); + } + if (not match(5,m_one[1])) { + setverdict(fail); + } + if (not match(2,m_one[2])) { + setverdict(fail); + } + + setverdict(pass); + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_002()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a9fd3a99fef50e1508f4ba43f8a3899f043a8d2 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_003.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that assignment to a anyvalue in the context of record of is handled correctly in two subsequent assignments. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150603_ReferencingRecordOfAndSetElements_003 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_003() runs on GeneralComp { + var template RoI m_one; + + m_one := ?; + m_one[2] := 2; + // assignment should yield {?,?,2,*} + m_one[4] := 3; + // assignment should yield {?,?,2,?,3,*} + + if (match(5,m_one[0]) and + match(5,m_one[1]) and + match(2,m_one[2]) and + match(5,m_one[3]) and + match(3,m_one[4]) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_003()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dbe21ca67d9f38dcaf6171ba1dc55db80004501f --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_004.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that assignment to a anyvalue in the context of record of is handled correctly when the first element is changed. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150603_ReferencingRecordOfAndSetElements_004 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_004() runs on GeneralComp { + var template RoI m_one; + + m_one := ?; + m_one[0] := 2; + // assignment should yield {2,*} + + if (not match(2,m_one[0])) { + setverdict(fail); + } + + setverdict(pass); + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_004()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_005.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f7a5f58c128097b71ebbca44608cfa0879aab49 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_005.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that access outside permutation fields is allowed and works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150603_ReferencingRecordOfAndSetElements_005 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_005() runs on GeneralComp { + var template RoI m_one; + var template integer m_two; + + m_one := {permutation(0,1,3,?),2,?}; + // assignment should yield ? + m_two := m_one[5]; + + if (match(5,m_two)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_005()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_006.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db39178538524bda7f964813f183337bc7d69316 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_006.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing an element within a record of, set of or array field to which omit is assigned works as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Restriction a) +/*Omit: referencing an element within a record of, set of or array field to which omit is assigned shall follow the rules specified in clause 6.2.3.*/ + + +module Sem_150603_ReferencingRecordOfAndSetElements_006 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_006() runs on GeneralComp { + var template RoI m_one; + var template RoI m_two := {6}; + + m_one := {1,-,3}; + // assignment should yield omit + m_two := m_one; + + if (ispresent(m_two)) { + setverdict(pass,m_two); + } else { + setverdict(fail,m_two); + } + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_006()); + } + + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_007.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ee8fdc5df010d861e32395d25a36a541b30cd42 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150603_referencing_record_of_and_set_elements/Sem_150603_ReferencingRecordOfAndSetElements_007.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.3, Ensure that referencing an element within a record of, set of or array field to which omit is assigned works as expected + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + + //Restriction g) +/* AnyElementsOrNone: when referencing an element of a record of or set of template or field that contains AnyElementsOrNone, the result of an operation + * is dependent on the position of AnyElementsOrNone, the referenced index and length attributes attached to AnyElementsOrNone. +*/ + + +module Sem_150603_ReferencingRecordOfAndSetElements_007 { + + type component GeneralComp { } + + type record of integer RoI; + + testcase TC_Sem_150603_ReferencingRecordOfAndSetElements_007() runs on GeneralComp { + var template RoI m_one; + + m_one := {1,?, * length(1..3), 5}; + m_one[1] := 2; + m_one[2] := 2; + + // assignment should yield {1,2,2,?,?,5} + + if (not match(1,m_one[0])) { + setverdict(fail,m_one); + } + if (not match(2,m_one[1])) { + setverdict(fail,m_one); + } + if (not match(2,m_one[2])) { + setverdict(fail,m_one); + } + + setverdict(pass); + } + + control{ + execute(TC_Sem_150603_ReferencingRecordOfAndSetElements_007()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NOTES b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..7053c8c82a19cacd09bd3cd54cddf1fb3b87088c --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NOTES @@ -0,0 +1 @@ +The semantic tests in this section require the corresponding remote procedure implemented \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NegSem_150604_ReferencingSignatureParameters_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NegSem_150604_ReferencingSignatureParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8df826b196cb2f7241cbac4382f31442a7efe5ad --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/NegSem_150604_ReferencingSignatureParameters_001.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.6.4, Test modification of signature parameters. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_150604_ReferencingSignatureParameters_001 { + +/** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + +signature p_NegSem_150604_ReferencingSignatureParameters_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + +template p_NegSem_150604_ReferencingSignatureParameters_001 s_baseTemplate := ( + {p_par1 := -, p_par2 := 4, p_par3 := ?} , {p_par1 := -, p_par2 := 4, p_par3 := 1} +); + +template p_NegSem_150604_ReferencingSignatureParameters_001 s_returnTemplate modifies s_baseTemplate := { + p_par3 := 5 +} //cannot modify list value template + +template p_NegSem_150604_ReferencingSignatureParameters_001 s_wrongTemplate modifies s_baseTemplate := { + p_par3 := 3 +} //cannot modify list value template + + + type port remotePort procedure { + out p_NegSem_150604_ReferencingSignatureParameters_001; + } + +type component GeneralComp { + port remotePort PCO; +} + +testcase TC_NegSem_150604_ReferencingSignatureParameters_001() runs on GeneralComp { + +} + +control{ + execute(TC_NegSem_150604_ReferencingSignatureParameters_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/Sem_150604_ReferencingSignatureParameters_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/Sem_150604_ReferencingSignatureParameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53eb048c0df7abd35bf19f626a1c04042cd3d74c --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150604_referencing_signature_parameters/Sem_150604_ReferencingSignatureParameters_001.ttcn @@ -0,0 +1,78 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.6.4, Test modification of signature parameters. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150604_ReferencingSignatureParameters_001 { + +/** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + +signature p_Sem_150604_ReferencingSignatureParameters_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + +template p_Sem_150604_ReferencingSignatureParameters_001 s_baseTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := ? +} + +template p_Sem_150604_ReferencingSignatureParameters_001 s_returnTemplate modifies s_baseTemplate := { + p_par3 := 5 +} + +template p_Sem_150604_ReferencingSignatureParameters_001 s_wrongTemplate modifies s_baseTemplate := { + p_par3 := 3 +} + +template p_Sem_150604_ReferencingSignatureParameters_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 +} + + type port remotePort procedure { + inout p_Sem_150604_ReferencingSignatureParameters_001; + } + +type component GeneralComp { + port remotePort PCO; +} + +function f_ptcBehaviour() runs on GeneralComp { + PCO.getcall(p_Sem_150604_ReferencingSignatureParameters_001:?); + PCO.reply(p_Sem_150604_ReferencingSignatureParameters_001:{-, 4, 5} value 1); +} + +testcase TC_Sem_150604_ReferencingSignatureParameters_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect (self:PCO, v_ptc:PCO); + v_ptc.start(f_ptcBehaviour()); + PCO.call(p_Sem_150604_ReferencingSignatureParameters_001:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_150604_ReferencingSignatureParameters_001:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_150604_ReferencingSignatureParameters_001:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_150604_ReferencingSignatureParameters_001:s_returnTemplate value 1) { //check that procedure is returning correct values + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_150604_ReferencingSignatureParameters_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b8ddcb5edd8ea5b198c307ac8ed3e0cfeebbd88 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_001.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables does not allow referencing alternatives inside an union with omit + ** @verdict pass reject + *****************************************************************/ + + //Restriction a) + /*referencing an alternative of a union template or template field to which Omit, AnyValueOrNone, + * a template list or a complemented list is assigned, at the right hand side of an assignment, shall cause an error.*/ + + + +module NegSem_150605_Referencing_union_alternatives_001 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + + + type component GeneralComp { } + + + testcase TC_NegSem_150605_Referencing_union_alternatives_001() runs on GeneralComp { + + + + + var template ExampleType m_template; + var template integer m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b:= omit; + + m_template_2 := m_template.b.u1; //error: omit + + setverdict(pass); + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acf53bb9ae3b8d923d31e7502f821a8b50873850 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_002.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables does not allow referencing alternatives inside an union with AnyValueOrNone + ** @verdict pass reject + *****************************************************************/ +//Restriction a) +/*referencing an alternative of a union template +or template field to which Omit, AnyValueOrNone, a template list or a complemented list is assigned, at the right hand side of an assignment, shall cause an error.*/ + + +module NegSem_150605_Referencing_union_alternatives_002 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + + + type component GeneralComp { } + + + testcase TC_NegSem_150605_Referencing_union_alternatives_002() runs on GeneralComp { + + + + + var template ExampleType m_template; + var template integer m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b:= *; + + m_template_2 := m_template.b.u1; //error: AnyValueOrNone + + setverdict(pass); + + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..039b928ce53cd91f54d7d252b06e934795ce203d --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_003.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables does not allow referencing alternatives inside an union with list + ** @verdict pass reject + *****************************************************************/ + + //Restriction a) +/*referencing an alternative of a union template +or template field to which Omit, AnyValueOrNone, a template list or a complemented list is assigned, at the right hand side of an assignment, shall cause an error.*/ + + +module NegSem_150605_Referencing_union_alternatives_003 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + + + type component GeneralComp { } + + + testcase TC_NegSem_150605_Referencing_union_alternatives_003() runs on GeneralComp { + + + + + var template ExampleType m_template; + var template integer m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b.u1:=(1,2); + m_template.b.u2:=2.0; + + m_template_2 := m_template.b.u1; //error: value list + + setverdict(pass); + + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59114102e65868f5b5163f984e3d56fd87c17509 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_004.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables does not allow referencing alternatives inside an union with complemented list + ** @verdict pass reject + *****************************************************************/ + + //Restriction a) +/*referencing an alternative of a union template +or template field to which Omit, AnyValueOrNone, a template list or a complemented list is assigned, at the right hand side of an assignment, shall cause an error.*/ + + +module NegSem_150605_Referencing_union_alternatives_004 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + + + type component GeneralComp { } + + + testcase TC_NegSem_150605_Referencing_union_alternatives_004() runs on GeneralComp { + + + + + var template ExampleType m_template; + var template integer m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b.u1:=complement(1,2); + m_template.b.u2:=2.0; + + m_template_2 := m_template.b.u1; //error: complement value list + + setverdict(pass); + + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_005.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..097f68900ee942ee86662859a3c781b36e247728 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_005.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that referencing an alternative of a union template field to which the ifpresent attribute is attached, shall cause an error + ** @verdict pass reject + *****************************************************************/ + +//Restriction c) +/*Ifpresent attribute: referencing an alternative of a union template field to which the ifpresent attribute is +attached, shall cause an error (irrespective of the value or the matching mechanism to which ifpresent is +appended).*/ + + +module NegSem_150605_Referencing_union_alternatives_005 { + + + type union My_Union { + integer u1, + float u2 + } + + type record My_Rec { + My_Union r1 optional + } + + type component GeneralComp { } + + + + testcase TC_NegSem_150605_Referencing_union_alternatives_005() runs on GeneralComp { + + var template integer m_template; + + + + var template My_Rec My_Template; + My_Template.r1 := {u1:=1} ifpresent; + + + m_template := My_Template.r1.u1; //error: ifpresent attribute is attached + + setverdict(pass,m_template); + + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_006.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2234f8616c90805257c5910e8c741a965307a3c3 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/NegSem_150605_Referencing_union_alternatives_006.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that referencing an alternative of an address type, which actual value is null shall cause + ** @verdict pass reject + *****************************************************************/ + +//Restriction d) +/*Special value null: referencing an alternative of an address type, which actual value is null shall cause +an error.*/ + + +module NegSem_150605_Referencing_union_alternatives_006 { + + type integer address; + + + type union My_Union { + integer u1, + address u2 + } + + + + + type component GeneralComp { } + + + + testcase TC_NegSem_150605_Referencing_union_alternatives_006() runs on GeneralComp { + + var template integer m_template; + + + + var template My_Union My_Template; + My_Template.u1 := 1; + My_Template.u2 := null; + + + + m_template := My_Template.u2; //error: null + + setverdict(pass); + + + } + + control{ + execute(TC_NegSem_150605_Referencing_union_alternatives_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_001.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fba63be4ab6015cf625e72f965c623cfc8f7ba33 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_001.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables allow referencing alternatives inside a union template definition + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_150605_Referencing_union_alternatives_001 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b + } + + type port loopbackPort message{inout ExampleType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + + testcase TC_Sem_150605_Referencing_union_alternatives_001() runs on GeneralComp { + + + + + var template ExampleType m_template; + + //assign values to template: + + m_template.a:=10; + m_template.b.u1:=1; + m_template.b.u2:=2.0; + + + messagePort.send(m_template); //send message + + alt { + [] messagePort.receive(m_template) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + + + } + + control{ + execute(TC_Sem_150605_Referencing_union_alternatives_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_002.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acbb5817978bee77b560f4eecab8b0655ffbdd17 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_002.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables allow referencing with an Anyvalue union template + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +//Restriction b) +/*when referencing an alternative of a union template or template field to which AnyValue is +assigned, at the right hand side of an assignment, AnyValue shall be returned.*/ + +module Sem_150605_Referencing_union_alternatives_002{ + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + type port loopbackPort message{inout ExampleType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + + testcase TC_Sem_150605_Referencing_union_alternatives_002() runs on GeneralComp { + + + + + + var template ExampleType m_template; + var template integer m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b := ?; + + m_template_2 := m_template.b.u1; //m_template_2 :=? + + if (ispresent(m_template_2)) + { + setverdict(pass,m_template_2); + } else { + setverdict(fail,m_template_2); + } + + } + + control{ + execute(TC_Sem_150605_Referencing_union_alternatives_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_003.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32342076a2f289bcef904960b4f219a50bdd3980 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_003.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables allow referencing with an Anyvalue union template + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +//Restriction b) +/*when referencing an alternative of a union template or template field to which AnyValue is +assigned, at the right hand side of an assignment, AnyValue shall be returned.*/ + +module Sem_150605_Referencing_union_alternatives_003 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b + } + + type port loopbackPort message{inout ExampleType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + + testcase TC_Sem_150605_Referencing_union_alternatives_003() runs on GeneralComp { + + var template ExampleType m_template; + var template ExampleType m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b := ?; + + m_template_2 := m_template; + + m_template_2.b.u1:=1; + + + if (match(valueof(m_template_2),{a := 10,b :={u1 := 1}})) + { + setverdict(pass,m_template_2); + } else { + setverdict(fail,m_template_2); + } + + } + + control{ + execute(TC_Sem_150605_Referencing_union_alternatives_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_004.ttcn b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cc8c5688d98d37920180f5d840a5804ea4ad7e8 --- /dev/null +++ b/ATS/core_language/15_templates/1506_referencing_elements_of_templates_or_template_fields/150605_Referencing_union_alternatives/Sem_150605_Referencing_union_alternatives_004.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.6.5, Ensure that template variables allow referencing with an Anyvalue union template + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +//Restriction a) +/*When referencing an alternative of a union template or template field to which AnyValueOrNone or omit is +assigned, at the left hand side of an assignment, the template field is implicitly set to be present and the +referenced alternative becomes the chosen one.*/ + +module Sem_150605_Referencing_union_alternatives_004 { + + type union My_Union { + integer u1, + float u2 + } + + type record ExampleType { // Exampletype record with union + integer a, + My_Union b optional + } + + type port loopbackPort message{inout ExampleType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + + testcase TC_Sem_150605_Referencing_union_alternatives_004() runs on GeneralComp { + + + + + + var template ExampleType m_template; + var template ExampleType m_template_2; + + //assign values to template: + + m_template.a:=10; + m_template.b := omit; + + m_template_2 := m_template; + + m_template_2.b.u1:=1; + + + if (match(valueof(m_template_2),{a := 10,b :={u1 := 1}})) + { + setverdict(pass,m_template_2); + } else { + setverdict(fail,m_template_2); + } + + } + + control{ + execute(TC_Sem_150605_Referencing_union_alternatives_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1507_template_matching_mechanisms/README b/ATS/core_language/15_templates/1507_template_matching_mechanisms/README new file mode 100644 index 0000000000000000000000000000000000000000..f165a664b75eebda9a4c7678f6ff68bf24c804bb --- /dev/null +++ b/ATS/core_language/15_templates/1507_template_matching_mechanisms/README @@ -0,0 +1 @@ +template matching tests can be found in B_matching_incoming_values. \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NOTES b/ATS/core_language/15_templates/1508_template_restrictions/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..f53723becd434bda1ade16c071c24945d09d9cbf --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NOTES @@ -0,0 +1 @@ +- TODO: grey fields in table 13 could be tested further with negative semantics tests... \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_001.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa4cce8cff2e89cf153a56e1334d0b50587d1ee6 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_001.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with anyvalue(?). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_001 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := ?; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_002.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88eb678359cbb81ec6136455cbdff7eecc234716 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_002.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with setof template. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_002 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := ({1,true},{2,false}); + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_003.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33d94c0587e7cc5991de89406462a7903bbea428 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_003.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with anyvalueornone(*). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_003 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := *; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_004.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a35e5e8e904eb1aa76c4ed30065f73bbd5487daa --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_004.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with value ranges. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_004 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := {(1..6), true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_005.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c86f279ce3cc9dd0804e1f96a56a192a7da664e --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_005.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with supersets. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_005 { + +type record ExampleType { + set of integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := {superset(1,2,3), true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_006.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59f0eafda618534c8a30c049a3b66f0153eb5877 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_006.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with subsets. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_006 { + +type record ExampleType { + set of integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmitAny := {subset(1,2,3), true}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_007.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..715884ddaa54d7a92b541679c9314b9509787a8b --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_007.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with patterns. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_007 { + +type record ExampleType { + integer a, + charstring b +} + +template(omit) ExampleType exampleOmitAny := {1, pattern "ab*c"}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_008.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f6d35f44ea5f15d20065a7cbb5eab41af097ea5 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_008.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with anyelement inside values. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_008 { + +type record ExampleType { + integer a, + charstring b +} + +template(omit) ExampleType exampleOmitAny := {2, ?}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_009.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..759b710ae5483ce379d6c034389621d3000fb50c --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_009.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with anyelemenornone inside values. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_009 { + +type record ExampleType { + integer a, + charstring b +} + +template(omit) ExampleType exampleOmitAny := {2, *}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_010.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0990db7add4dc51ea28a31bd2d2ee45c2bcdeba9 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_010.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with permutation inside values. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_010 { + +type record ExampleType { + set of integer a, + charstring b +} + +template(omit) ExampleType exampleOmitAny := {permutation(2,4,6),"abcde"}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_011.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73c9b143cc21bef0766ebc058e3070e26f0c4bda --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_011.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with length restrictions. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_011 { + +type record ExampleType { + charstring b +} + +template(omit) ExampleType exampleOmitAny := {"abcde" length(1..3)}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_012.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a26abe9e5bda45a317e4986cfcb57426a4fdc8dd --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_012.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with length restrictions. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_012 { + +type record ExampleType { + charstring b +} + +template(omit) ExampleType exampleOmitAny := {"abcde" ifpresent}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_013.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d42fc024b02d1573f5bba36ce22d0efb44a1e9e1 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_013.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is rejected with length restrictions. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_013 { + +type record ExampleType { + integer f1 +} + +template(omit) ExampleType exampleOmitAny := {complement(2,3)}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_014.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62081718bcd5470b192dee38f3e71bcf8839af1d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_014.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with anyvalue(?). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_014 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := ?; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_015.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61a315c4cc9a12368694ca9786bad5aa5e74a490 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_015.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with valuelist. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_015 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := ({1,true},{2,false}); + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_016.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9571ac0a4ab1b6cbb42e79379bc5f73580464fbe --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_016.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with anyvalueornone(*). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_016 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := *; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_017.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8eee573ab80f7ed72d254e6b27698bab5d07ed05 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_017.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with value ranges. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_017 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := {(1..6), true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_018.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cf84ac68e940e6bfc9b1df4a26d61af7b654b48 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_018.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with supersets. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_018 { + +type record ExampleType { + set of integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := {superset(1,2,3), true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_019.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb3f79be7bbffa17bdac63f05b275e313b4f3408 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_019.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with supersets. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_019 { + +type record ExampleType { + set of integer a, + boolean b optional +} + +template(value) ExampleType exampleOmitAny := {superset(1,2,3), true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_020.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7cc7f7ad193e656e150bc1cfa02182a297e10d7 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_020.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with patterns. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_020 { + +type record ExampleType { + integer a, + charstring b +} + +template(value) ExampleType exampleOmitAny := {1, pattern "ab*c"}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_021.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4c6ec2d9863a278ec754b38f1a5191c3890376d1 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_021.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with anyelement inside values. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_021 { + +type record ExampleType { + integer a, + charstring b +} + +template(value) ExampleType exampleOmitAny := {2, ?}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_022.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f474cbe373dbbc1d4f0b604dc01fc93cdb33fa87 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_022.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with permutation inside values. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_022 { + +type record ExampleType { + set of integer a, + charstring b +} + +template(value) ExampleType exampleOmitAny := {permutation(2,4,6),"abcde"}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_023.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94be4c7ce048ef85277eb9261fc16175555cee9d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_023.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with length restrictions. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_023 { + +type record ExampleType { + charstring b +} + +template(value) ExampleType exampleOmitAny := {"abcde" length(1..3)}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_024.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db38b86d6fa7fe192527b08802c89e3c3adcdd2a --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_024.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is rejected with length restrictions. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_024 { + +type record ExampleType { + charstring b +} + +template(value) ExampleType exampleOmitAny := {"abcde" ifpresent}; + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_025.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac60f935526d7669f1ba47b8a1400e064739cc3d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_025.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) refuses omitvalue as a whole. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_025 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(present) ExampleType exampleOmit := omit; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_026.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c94592fc9dc53b023a3c80fa0630c96bdd6f1e15 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_026.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) refuses omit as a whole. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_026 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmit := omit; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_029.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aabaa076bb30b1f3de7c5cb62bc81b6c04255c3e --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_029.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the template(present) with anyvalue(?) can't be assigned to an omit restricted variable template + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_029 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a, + boolean b + } + + type component GeneralComp { + var template (omit) ExampleType v_omit; //omit restricted template variable + } + + + template (present) ExampleType MyintTemplate :={ //actual template with present restriction contains anytype (?) + a := ?, + b := false + } + + + testcase TC_NegSem_1508_TemplateRestrictions_029() runs on GeneralComp { + + v_omit := MyintTemplate; //error: v_omit is omit restricted, hence can not contain anytype(?) + + if (valueof(v_omit.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_029()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_030.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8180e6b1f1180b9448977b97e1c215f0721120bd --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_030.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted template with anyvalue(?) can't be assigned to an omit restricted variable template + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_030 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a optional, + boolean b + } + + type component GeneralComp { + var template (omit) ExampleType v_omit; //omit restricted template variable + } + + + template ExampleType MyintTemplate :={ //actual template without restriction contains anyvalue (?) + a := ?, + b := false + } + + + testcase TC_NegSem_1508_TemplateRestrictions_030() runs on GeneralComp { + + v_omit := MyintTemplate; //error: v_omit is omit restricted, hence can not contain anyvalue(?) + + if (valueof(v_omit.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_030()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_031.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..29594a67d00dbd4cabd9dc8de7a4a921f895f071 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_031.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) can't be assigned to a variable template(value) if omit + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_031 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a optional, + boolean b + } + + type component GeneralComp { + var template (value) ExampleType v_value; //value restricted template variable + } + + + template (omit) ExampleType MyintTemplate :=omit; //actual template (with omit restriction) is omit + + + + testcase TC_NegSem_1508_TemplateRestrictions_031() runs on GeneralComp { + + v_value := MyintTemplate; //error: v_value is value restricted, hence can not be omit + + if (valueof(v_value.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_031()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_032.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34944902de7ffcc3d22b8bd4830afb1e2f3b619e --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_032.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) can't be assigned to a template(value) variable if contains anyvalueornone(*) + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_032 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a optional, + boolean b + } + + type component GeneralComp { + var template (value) ExampleType v_value; //value restricted template variable + } + + + template (present) ExampleType MyintTemplate :={ //actual template (with present restriction) contains * + a := *, + b:= true + } + + + + + testcase TC_NegSem_1508_TemplateRestrictions_032() runs on GeneralComp { + + v_value := MyintTemplate; //error: v_value is value restricted, hence can not contain * + + if (valueof(v_value.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_032()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_033.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e2a51c7847d75168ec111f0053ceb8658da5aec --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_033.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that an unrestricted template can't be assigned to a template(value) variable if contains anyvalueornone(*) + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_033 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a optional, + boolean b + } + + type component GeneralComp { + var template (value) ExampleType v_value; //value restricted template variable + } + + + template ExampleType MyintTemplate :={ //actual template (without restriction) contains * + a := *, + b:= true + } + + + + + testcase TC_NegSem_1508_TemplateRestrictions_033() runs on GeneralComp { + + v_value := MyintTemplate; //error: v_value is value restricted, hence can not contain * + + if (valueof(v_value.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_033()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_034.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e16d7c5c4e68264de0935a44cd63f70af3ce85b3 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_034.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template with omit restriction can't be assigned to a template(present)variable if omit + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_034 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a , + boolean b optional + } + + type component GeneralComp { + var template (present) ExampleType v_present; //value restricted template variable + } + + + template (omit) ExampleType MyintTemplate := omit; //actual template (omit) is omit + + + + + testcase TC_NegSem_1508_TemplateRestrictions_034() runs on GeneralComp { + + v_present := MyintTemplate; //error: v_present is present restricted, hence can not be omit + + if (valueof(v_present.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_034()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_035.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..240ba0c2c6ba455745a29f13f4c10eb2fa04bb94 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_035.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that an unrestricted template can't be assigned to a template(present)variable if omit + ** @verdict pass reject + *****************************************************************/ + + +module NegSem_1508_TemplateRestrictions_035 { + + type record ExampleType { // Exampletype record contains a charstring and a boolean + charstring a , + boolean b optional + } + + type component GeneralComp { + var template (present) ExampleType v_present; //value restricted template variable + } + + + template ExampleType MyintTemplate := omit; //actual template is omit + + + + + testcase TC_NegSem_1508_TemplateRestrictions_035() runs on GeneralComp { + + v_present := MyintTemplate; //error: v_present is present restricted, hence can not be omit + + if (valueof(v_present.b) == false) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_035()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_036.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8dd39dc74dcdaf3574070e6c6a8deb5d401b9437 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_036.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) can't be parameter to a template(omit) if contains anyvalueornone(*) + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_036 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (omit) ExampleType m_baseTemplate(template (present) integer MyintTemplate := *) :={ + a := MyintTemplate, // template (present) MyintTemplate contains anyvalueornone(*), which is not allowed in omit restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_036() runs on GeneralComp { + + + if (valueof(m_baseTemplate.b) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_036()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_037.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e402abb893a216537e11f0fa191792911c21a8c --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_037.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) can't be parameter to template(omit) if contains anyvalue(?) + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_037 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (omit) ExampleType m_baseTemplate(template integer MyintTemplate := ?) :={ + a := MyintTemplate, // template MyintTemplate contains anyvalue(?), which is not allowed in omit restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_037() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_037()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_038.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1499a445e1f9b9db92ed74bab24140f7fb9203b0 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_038.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) can't be parameter to template(value) if it is omit + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_038 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (omit) integer MyintTemplate := omit) :={ + a := MyintTemplate, // template (omit) MyintTemplate is omit, which is not allowed with value restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_038() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_038()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_039.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3b3bb408c5b644d309e0cf6a4e49cf17a890b2f --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_039.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) can't be parameter to template(value) if it contains anyvalueornone(*) + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_039 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (present) integer MyintTemplate := *) :={ + a := MyintTemplate, // template (present) MyintTemplate contains anyvalueornone(*), which is not allowed with value restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_039() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_039()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_040.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5eb8a47b5209d8dfb0b1e3a084e0407d7f1044f4 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_040.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted template can't be parameter to template(value) if it contains anyvalueornone(*) + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_040 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template integer MyintTemplate := *) :={ + a := MyintTemplate, // template MyintTemplate contains anyvalueornone(*), which is not allowed with value restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_040() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_040()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_041.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ffb4de2062c084535fb267677248dbe32b7b0dc8 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_041.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template (omit) can't be parameter to template(present) if it contains omit + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_041 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (present) ExampleType m_baseTemplate(template (omit) integer MyintTemplate := omit) :={ + a := MyintTemplate, // template (omit) MyintTemplate contains omit, which is not allowed with present restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_041() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_041()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_042.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..362cf5220bf16060f3030210a061d6741d704e32 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_042.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the an unrestriced template can't be parameter to template(present) if it contains omit + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_042 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (present) ExampleType m_baseTemplate(template integer MyintTemplate := omit) :={ + a := MyintTemplate, // template MyintTemplate contains omit, which is not allowed with present restriction + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_042() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_042()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_049.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e5af364e6f6c5d94387fb38f79eafdcefcc3138 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_049.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(present) can't be parameter to a template(omit) + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1508_TemplateRestrictions_049 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (omit) ExampleType m_baseTemplate(template (present) integer MyintTemplate := ?) :={ + a := MyintTemplate, // template (present)is not allowed parameter in omit restriction + // if the content is wrong (see the note in table 13) + b := true + } + + testcase TC_NegSem_1508_TemplateRestrictions_049() runs on GeneralComp { + + + if (valueof(m_baseTemplate.b) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_1508_TemplateRestrictions_049()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_050.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd5167f641025607e7a17ebc6250bf7f33de9a49 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_050.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that decoded content match is not allowed for omit template restriction + ** @verdict pass reject, noexecution + ***************************************************/ + +module NegSem_1508_TemplateRestrictions_050 { + + type record MessageType { + hexstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + +testcase TC_NegSem_1508_TemplateRestrictions_050() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template (omit) MessageType mw_matchingTemplate:= { + payload := decmatch Mymessage: {field1:= 10, field2 := omit} //error: omit restriction not allowed + } + + v_testMessage:= { + field1 := 10, + field2 := '1001'B + } + + Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload + + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail,mw_matchingTemplate); + } + } + +} + +control{ + execute(TC_NegSem_1508_TemplateRestrictions_050()); +} + +} diff --git a/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_051.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eaad9ba4ec58f71338228da5d84175b8564d300b --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/NegSem_1508_TemplateRestrictions_051.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that decoded content match is not allowed for omit template restriction + ** @verdict pass reject, noexecution + ***************************************************/ + +module NegSem_1508_TemplateRestrictions_051 { + + type record MessageType { + hexstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + +testcase TC_NegSem_1508_TemplateRestrictions_051() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template (value) MessageType mw_matchingTemplate:= { + payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B} //error: value restriction not allowed + } + + v_testMessage:= { + field1 := 10, + field2 := '1001'B + } + + Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail,mw_matchingTemplate); + } + } + +} + +control{ + execute(TC_NegSem_1508_TemplateRestrictions_051()); +} + +} diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_001.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e091c1feca0278d66f690d3234f2fbb90555dd8f --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a value can be assigned to a template(omit) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_001 { + +type component GeneralComp { } + +testcase TC_Sem_1508_TemplateRestrictions_001() runs on GeneralComp { + var template(omit) integer v_omit; + + v_omit := 20; + + if (valueof(v_omit) == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_001()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_002.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2f7bae06dca1944492bf6d87db9356611d8dc4a --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(omit) can be assigned to a template(omit) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_002 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmit := omit; + +testcase TC_Sem_1508_TemplateRestrictions_002() runs on GeneralComp { + var template(omit) ExampleType v_omit; + + v_omit := exampleOmit; + + if ( ispresent(v_omit) ) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_002()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_003.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f80a3ff3df923c69894c114c08679286620c077 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a templat(value) can be assigned to a template(omit) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_003 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleValueOptional := {1, omit}; + +testcase TC_Sem_1508_TemplateRestrictions_003() runs on GeneralComp { + var template(omit) ExampleType v_omit; + + v_omit := exampleValueOptional; + + if (match(valueof(v_omit.a), 1) and + match(ispresent(v_omit.b), false ) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_003()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_004.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccec92501c978231f71a820c7e5c71090ddc064f --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_004.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a value can be assigned to a template(value) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_004 { + +type component GeneralComp { } + +testcase TC_Sem_1508_TemplateRestrictions_004() runs on GeneralComp { + var template(value) integer v_value; + + v_value := 20; + + if (valueof(v_value) == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_004()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_005.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a820f8885584a30e40594a0e8fd06caa2ed9f06 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_005.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(value) can be assigned to a template(value) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_005 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleValue := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_005() runs on GeneralComp { + var template(value) ExampleType v_value; + + v_value := exampleValue; + + if (match(valueof(v_value.a), 1) and + match(valueof(v_value.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_005()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_006.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7cb2b7a8451d14243a09ba9e7f0b3fad099bf768 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_006.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a value can be assigned to a template(present) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_006 { + +type component GeneralComp { } + +testcase TC_Sem_1508_TemplateRestrictions_006() runs on GeneralComp { + var template(present) integer v_present; + + v_present := 20; + + if (valueof(v_present) == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_006()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_007.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2606d2be70679b631eece32f02603829755d37d0 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_007.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(omit) can be assigned to a template(present) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_007 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmit := {1, omit}; + +testcase TC_Sem_1508_TemplateRestrictions_007() runs on GeneralComp { + var template(present) ExampleType v_present; + + v_present := exampleOmit; + + if (match(valueof(v_present.a), 1) and + match(ispresent(v_present.b), false) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_007()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_008.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25fc2b674292c1b3efcd69bc4646662f826accb4 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_008.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(value) can be assigned to a template(present) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_008 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleValue := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_008() runs on GeneralComp { + var template(present) ExampleType v_present; + + v_present := exampleValue; + + if (match(valueof(v_present.a), 1) and + match(valueof(v_present.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_008()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_009.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40e32267a01cad53f20d16492ae5813f979fceb1 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_009.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(present) can be assigned to a template(present) variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_009 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(present) ExampleType examplePresent := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_009() runs on GeneralComp { + var template(present) ExampleType v_present; + + v_present := examplePresent; + + if (match(valueof(v_present.a), 1) and + match(valueof(v_present.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_009()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_010.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53dcbf4ab9b14c8681fb63314ae660bbac9f54d8 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_010.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a value can be assigned to a template variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_010 { + +type component GeneralComp { } + +testcase TC_Sem_1508_TemplateRestrictions_010() runs on GeneralComp { + var template integer v_template; + + v_template := 20; + + if (valueof(v_template) == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_010()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_011.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..443cbe6f29dd838f4575080e22119ddad65d8e8f --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_011.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(omit) can be assigned to a template variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_011 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmit := {1, omit}; + +testcase TC_Sem_1508_TemplateRestrictions_011() runs on GeneralComp { + var template ExampleType v_template; + + v_template := exampleOmit; + + if (match(valueof(v_template.a), 1) and + match(ispresent(v_template.b), false) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_011()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_012.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eeda4d1c87a41009958a971b12aef583f379a108 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_012.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(value) can be assigned to a template variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_012 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleValue := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_012() runs on GeneralComp { + var template ExampleType v_template; + + v_template := exampleValue; + + if (match(valueof(v_template.a), 1) and + match(valueof(v_template.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_012()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_013.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fbd96fdb02580a2a5c6c4f719fe1546a95567d00 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_013.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(present) can be assigned to a template variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_013 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template(present) ExampleType examplePresent := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_013() runs on GeneralComp { + var template ExampleType v_template; + + v_template := examplePresent; + + if (match(valueof(v_template.a), 1) and + match(valueof(v_template.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_013()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_014.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c772ba3b4fdb3b7d493ace28a7323828df6711a --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_014.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template can be assigned to a template variable. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_014 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template ExampleType exampleTemplate := {1, true}; + +testcase TC_Sem_1508_TemplateRestrictions_014() runs on GeneralComp { + var template ExampleType v_template; + + v_template := exampleTemplate; + + if (match(valueof(v_template.a), 1) and + match(valueof(v_template.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_014()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_015.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..771a58c455780872169f42ef703fadbd8ec46b3d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_015.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a base template can be modified without restrictions. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_015 { + +type component GeneralComp { } + +type record ExampleType { + integer a, + boolean b optional +} + +template ExampleType m_baseTemplate := { + a := 20, + b := true +} + +template ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 +} + +testcase TC_Sem_1508_TemplateRestrictions_015() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_015()); +} + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_016.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20629cefa10ce32ce0445fbfd15b4701d8db0ef7 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_016.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a base template can be modified with template(present) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_016 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_016() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_016()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_017.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bd6f3fc5e4f1ee1c06dc352d0ffdf93586c7034 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_017.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a base template can be modified with template(omit) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_017 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_017() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_017()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_018.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..944691f08c8802399935a800e0ecc71277339dcd --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_018.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a base template can be modified with template(value) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_018 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_018() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_018()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_019.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..269dc9db691a0b8372c62c75fc704f1fcae43ac8 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_019.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(present) base template can be modified with template(present) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_019 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_019() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_019()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_020.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4e117168373ab1817c331b4bd8df1796b1e396c --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_020.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(present) base template can be modified with template(value) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_020 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_020() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_020()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_021.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a65f5827e683de9c14aadbde88df984db3317a69 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_021.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(omit) base template can be modified with template(omit) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_021 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_021() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_021()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_022.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb5c83249f3c50f1448d840d6f470780d9384dee --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_022.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(omit) base template can be modified with template(value) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_022 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_022() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_022()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_023.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ecf8683209ed7fdafd5c9f5309575651cb67d5b --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_023.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that a template(value) base template can be modified with template(value) restriction. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_023 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(value) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(value) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 22 + } + + testcase TC_Sem_1508_TemplateRestrictions_023() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 22) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_023()); + } + + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_024.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab0a677abd2ecc8a5a271e46fe20da045af141e0 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_024.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) base templates are allowed to be modfied to template(omit). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_024 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_024() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_024()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_025.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e97568451c836ed5718168cc06579f1395603e53 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_025.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) base templates are allowed to be modfied to template(present). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_025 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_025() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_025()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_026.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2686216bf740e63612250e51adae695e82c4575 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_026.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) base templates are allowed to be modfied to template(present). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_026 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(value) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template(present) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_026() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_026()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7c85a2e3cd2e0fcbc6ddf5a625a37ca8ec5c942 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_027.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) base templates are allowed to be modfied to template(omit). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_027 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(value) ExampleType m_baseTemplate := { + a := 20, + b := true + } + +// shall be rejected as template(omit) is not an allowed restriction for template(value) +// templates + template(omit) ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_027() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_027()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_028.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..941946593cc20bca8fa693ed326f2b475b135837 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_028.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) base templates are allowed to be modfied to template. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_028 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(value) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_028() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_028()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_029.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..068e69d60b58486d72df11296717ba52585b8791 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_029.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) base templates are allowed to be modfied to template. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_029 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(omit) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_029() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_029()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_030.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc3cf2f6eb6cf77a0ac188e94f0d7c17885878a3 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_030.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) base templates are allowed to be modfied to template. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +module Sem_1508_TemplateRestrictions_030 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate := { + a := 20, + b := true + } + + template ExampleType m_modifiedTemplate modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_030() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate.a), 21) and + match(valueof(m_modifiedTemplate.b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_030()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_031.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a292d07da89ef19c76775b7219899414f16e1474 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_031.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(value)->template(present) is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_031 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(value) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template(present) integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_031() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_031()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_032.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91141099b1877c670bd29d92764fd45c1ffca3b5 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_032.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(value)->template(omit) is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_032 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(value) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template(omit) integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_032() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_032()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_033.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7dd9aff0d7cbd25d578553585951a23d42670b7 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_033.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(value)->template is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_033 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(value) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_033() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_033()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_034.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66f39257ea75812d88c14edf8511f68de0a59b08 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_034.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(omit)->template(present) is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_034 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(omit) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template(present) integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_034() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_034()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_035.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..312f001813ffa5dbda51a5151b583fe84c47327d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_035.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(omit)->template(present) is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_035 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(omit) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_035() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_035()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_036.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c2d320cf2adb0e51c403db47c47251409fdc8cd --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_036.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the restrictiveness of parameters template(omit)->template(present) is handled correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// ATTENTION: valid for TTCN-3:2013 (ETSI ES 201 873-1 V4.5.1) and newer +// Older versions of the core languate standard didn't allow this type of +// modification because of restriction 15.8.c. + +/* +Pro opinion: +Test an intentional change made on the request of the STF160 in TTCN-3:2013. In particular, restriction 15.8.c was taken away from the core language specification (as marked in test case comments). This restriction did indeed mean that the tests would behave as you described, thus producing an error. However, with the restriction missing, the tests are perfectly valid. I also do not understand why you claim that it would not be possible to instantiate super-templates in these cases. Restrictions are always related to actual values and if the values satisfy both restrictions (parent and modified), there's no problem at all. And this is exactly what these test intend to verify. +Besides, the core language specification does not say that the parameters must be the same. There's a rule saying that the parameters shall not be omitted. It is rather unfortunate wording, because it might be interpreted in several ways. There's a CR 6692 regarding this issue. + +Contra opinion +The problem is with the semantics of modified templates. For every actual parameter list, first, the template-to-be-modified is implicitly instantiated and then modified by the given modifications. If the template-to-be-modified is not defined for the actual parameters, then neither is the modified one. Of course, you are right in that this restriction could be applied for actual parameters only and need not be checked at the template-level already. However, it does not make sense to lessen the template restriction of a parameter, as implicitly, it still keeps the stronger restriction (because of the modification-semantics). Therefore, it is misleading to SEEMINGLY allow a template(present) parameter for a template where the super-template has a template(value) parameter. If allowed, the user might use a non-value template as an actual parameter and then get a runtime error, even though the template-restriction matched the one in the formal parameter of the template. Therefore, we interpret the standard in such a way that the inheritance of the parameters includes the inheritance of both the types and the template restrictions of the inherited parameters. Strengthening of template restrictions would indeed not be a problem. Lessening is. + +*/ + +module Sem_1508_TemplateRestrictions_036 { + + type component GeneralComp { } + + type record ExampleType { + integer a, + boolean b optional + } + + template(present) ExampleType m_baseTemplate(template(present) integer p_myInt) := { + a := p_myInt, + b := true + } + + template(present) ExampleType m_modifiedTemplate(template integer p_myInt) modifies m_baseTemplate := { + a := 21 + } + + testcase TC_Sem_1508_TemplateRestrictions_036() runs on GeneralComp { + if (match(valueof(m_modifiedTemplate(1).a), 21) and + match(valueof(m_modifiedTemplate(1).b), true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_036()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_043.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c081dcabbe80aaf2c4422650bee7e1e39d8ce4b3 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_043.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that the an unrestriced template can be parameter to template(present) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_043 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (present) ExampleType m_baseTemplate(template integer MyintTemplate := 21) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_043() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_043()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_044.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96fa9d0c72e59b7f20909ec3278b054a230dee9d --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_044.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template (omit) can be parameter to template(present) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_044 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (present) ExampleType m_baseTemplate(template (omit) integer MyintTemplate := 21) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_044() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_044()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_045.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14c92b19c8e577412376e316aef344b8aabda470 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_045.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that unrestricted template can be parameter to template(value) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_045 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template integer MyintTemplate := 1) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_045() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_045()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_046.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be96222c2d7795611c0c0e1fa5f70457b33a0ca6 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_046.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(present) can be parameter to template(value) + ** @verdict pass reject + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_046 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (present) integer MyintTemplate := ?) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_046() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_046()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_047.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d450e2f00a421b50281ac641cffa5f0ad0826d5 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_047.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(omit) can be parameter to template(value) + ** @verdict pass reject + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_047 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (value) ExampleType m_baseTemplate(template (omit) integer MyintTemplate := omit) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_047() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_047()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_048.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71b240c5833a1be3f47b5726dcb8a71011a30a3c --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_048.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, Ensure that template(present) can be parameter to template(omit) + ** @verdict pass reject + *****************************************************************/ + +module Sem_1508_TemplateRestrictions_048 { + + type record ExampleType { // Exampletype record integer and a boolean + integer a, + boolean b + } + + type component GeneralComp { + } + + + + template (omit) ExampleType m_baseTemplate(template integer MyintTemplate := ?) :={ + a := MyintTemplate, + b := true + } + + testcase TC_Sem_1508_TemplateRestrictions_048() runs on GeneralComp { + + + if (ispresent(m_baseTemplate.a) == true) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_048()); + } +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e8ce01125109b8a1b5fdaeb34d11081d9e151bf --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that decoded content match is allowed for present template restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + +module Sem_1508_TemplateRestrictions_049 { + + type record MessageType { + hexstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + testcase TC_Sem_1508_TemplateRestrictions_049() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template (present) MessageType mw_matchingTemplate := { + payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B} + } + + v_testMessage := { + field1 := 10, + field2 := '1001'B + } + + Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail,mw_matchingTemplate); + } + } + } + + control{ + execute(TC_Sem_1508_TemplateRestrictions_049()); + } + +} diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_050.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56ca4873dfe50b9d5780957d3ee7c96c594f793c --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_050.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, ensure that symbols created during template expansion are checked against omit template restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing elements of templates or templates fields with the value or omit +// restriction, the rules for referencing elements of values are used. + +// Note: +// Older rules (TTCN-3:2014) didn't contain this restriction. This caused the following test +// to end with a dynamic error + +module Sem_1508_TemplateRestrictions_050 { + +type component GeneralComp { } + +type record R { + integer field1, + integer field2 +} + +testcase TC_Sem_1508_TemplateRestrictions_050() runs on GeneralComp { + var omit R v_test := omit; + v_test.field1 := 0; // As the result of expansion, v_test value is { field1 := -, field2 := - } + // After the field assignment it changes to { field1 := 0, field2 := - } + // In the older versions, the result was { field1 := 0, field2 := ? } + // which violated the omit restriction + if (valueof(v_test.field1) == 0 and not isbound(v_test.field2)) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_050()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_051.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..457592535bdb54e1b96237ec39d96c30c14d09de --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_051.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.8, ensure that symbols created during template expansion are checked against value template restriction + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// When referencing elements of templates or templates fields with the value or omit +// restriction, the rules for referencing elements of values are used. + +// Note: +// Older rules (TTCN-3:2014) didn't contain this restriction. This caused the following test +// to end with a dynamic error + +module Sem_1508_TemplateRestrictions_051 { + +type component GeneralComp { } + +type record R { + record + { + integer subfield1, + integer subfield2 + } field1 optional, + integer field2 +} + +testcase TC_Sem_1508_TemplateRestrictions_051() runs on GeneralComp { + var template(value) R v_test := { field1 := omit, field2 := 2 }; + v_test.field1.subfield1 := 0; // As the result of expansion, v_test value is { field1 := { -, - }, field2 := 2 } + // After the field assignment it changes to { field1 := { 0, - }, field2 := 2 } + // In the older versions, the result was { field1 := { 0, ? }, field2 := ? } + // which violated the value restriction + + if (valueof(v_test.field1.subfield1) == 0 and not isbound(v_test.field1.subfield2)) { setverdict(pass); } + else { setverdict(fail); } +} + +control{ + execute(TC_Sem_1508_TemplateRestrictions_051()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_001.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff838aec2df56e1f7d99399a31fdec54923df1d3 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_001.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is accepted with value omitvalue. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1508_TemplateRestrictions_001 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmit := omit; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_002.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac3f28882db959ae408a7c165d7a3a93899ad4d8 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_002.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(omit) is accepted with a concrete value. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1508_TemplateRestrictions_002 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(omit) ExampleType exampleOmit := {1, true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_003.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..355de0217cc3f0a1c409418da2a455efc27e30f4 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_003.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(value) is accepted with a concrete value. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1508_TemplateRestrictions_003 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(value) ExampleType exampleOmit := {1, true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_004.ttcn b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b00217a22b36be6e935454d8fdf36cf4e943044 --- /dev/null +++ b/ATS/core_language/15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_004.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.8, Ensure that template(present) is accepted with a concrete value. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1508_TemplateRestrictions_004 { + +type record ExampleType { + integer a, + boolean b optional +} + +template(present) ExampleType exampleOmit := {1, true}; + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/NOTES b/ATS/core_language/15_templates/1509_match_operation/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..a3c8564f258d6868d71abe1e4a6c5c492f476a55 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/NOTES @@ -0,0 +1 @@ +- NOTE: This could be extended to cover any kinds of types and wildcards. We keep this simple. \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_001.ttcn b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8eeadf8b299a2f400ebf9056608bafa6419ff84 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation refuses two templates as actual parameters. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1509_MatchOperation_001 { + +type component GeneralComp { } + +template integer m_lessThan10 := (-infinity..9); +template integer m_second := (-20,-40); + +testcase TC_NegSem_1509_MatchOperation_001() runs on GeneralComp { + if (match(m_second, m_lessThan10)) { // shall fail as both actual parameters refer to templates + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_NegSem_1509_MatchOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_002.ttcn b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ecc4b68da95e840210c62124fda2007158dba64 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation refuses not initialized operands. + ** @verdict pass reject + *****************************************************************/ + +// Restriction b) The operands of the match operation shall be completely initialized. + +module NegSem_1509_MatchOperation_002 { + +type component GeneralComp { } + +template integer m_lessThan10 := (-infinity..9); + +testcase TC_NegSem_1509_MatchOperation_002() runs on GeneralComp { + + var integer v_value; + + + if (match(v_value, m_lessThan10)) { // error: The operands of the match operation shall be completely initialized. + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1509_MatchOperation_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_003.ttcn b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f68aa2c2e9178e497b03ca5da82f99bfc71492eb --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/NegSem_1509_MatchOperation_003.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly with enums. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1509_MatchOperation_003 { + +type component GeneralComp { } + +type enumerated A_enum { A, B, C, D, E }; +type enumerated B_enum { A, F, G }; + +testcase TC_NegSem_1509_MatchOperation_003() runs on GeneralComp { + + var A_enum v_value := A; + + + if (match(v_value, G)) { // error: different enum type + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1509_MatchOperation_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_001.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b027898e361bdeaa9ea18396f48f482d6f8cc807 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works as expected on a template with range restriction when the tested value is inside the range. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_001 { + +type component GeneralComp { } + +template integer m_lessThan10 := (-infinity..9); + +testcase TC_Sem_1509_MatchOperation_001() runs on GeneralComp { + var integer v_value := -20; + + if (match(v_value, m_lessThan10)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_002.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c83109c2ab50170f5b2ad0d6b1c5df7dbb2732d0 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_002.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works as expected on a template with range restriction when the tested value is outside the range. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_002 { + +type component GeneralComp { } + +template integer m_lessThan10 := (-infinity..9); + +testcase TC_Sem_1509_MatchOperation_002() runs on GeneralComp { + var integer v_value := 20; + + if (match(v_value, m_lessThan10)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_003.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4f71b069c009d0ff14436528e6035e0859c1d6b --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly on records in the positive case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_003 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + boolean field2 +} + +template MyRecord m_receiveTemplate := { + field1 := pattern "ab*de", + field2 := ? +} + +testcase TC_Sem_1509_MatchOperation_003() runs on GeneralComp { + var MyRecord v_value := { + field1 := "abcde", + field2 := true + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_004.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c0dcedbeb6525e357b9c220cae10cc40548636a --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly on records in the negative case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_004 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + boolean field2 +} + +template MyRecord m_receiveTemplate := { + field1 := "ab*de", + field2 := ? +} + +testcase TC_Sem_1509_MatchOperation_004() runs on GeneralComp { + var MyRecord v_value := { + field1 := "abc", + field2 := true + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_006.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..550220d0f44add92c506362b021ad90b195fceb3 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_006.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly on records with optional fields in the positive case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_006 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + boolean field2 optional +} + +template MyRecord mw_receiveTemplate := { + field1 := pattern "ab*de", + field2 := * +} + +testcase TC_Sem_1509_MatchOperation_006() runs on GeneralComp { + var MyRecord v_value := { + field1 := "abcde", + field2 := omit + } + + if (match(v_value, mw_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_007.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..329478c558e47f022ae5747e002f3c024079ef9c --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_007.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly on sets in the positive case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_007 { + +type component GeneralComp { } + +type set MySet { + charstring field1, + boolean field2 +} + +template MySet mw_receiveTemplate := { + field1 := pattern "ab*de", + field2 := ? +} + +testcase TC_Sem_1509_MatchOperation_007() runs on GeneralComp { + var MySet v_value := { + field1 := "abcde", + field2 := true + } + + if (match(v_value, mw_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_007()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_008.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38d87c89d9fe5214756b3f631ab2d2902078b86b --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_008.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.9, Ensure that the match operation works correctly on sets in the negative case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_008 { + +type component GeneralComp { } + +type set MySet { + charstring field1, + boolean field2 +} + +template MySet mw_receiveTemplate := { + field1 := "ab*de", + field2 := ? +} + +testcase TC_Sem_1509_MatchOperation_008() runs on GeneralComp { + var MySet v_value := { + field1 := "abc", + field2 := true + } + + if (match(v_value, mw_receiveTemplate)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_008()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_010.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f55a6b9c31d5767679c248a7996150e8d4b1f5fa --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_010.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly on sets with optional fields in the positive case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_010 { + +type component GeneralComp { } + +type set MySet { + charstring field1, + boolean field2 optional +} + +template MySet mw_receiveTemplate := { + field1 := pattern "ab*de", + field2 := * +} + +testcase TC_Sem_1509_MatchOperation_010() runs on GeneralComp { + var MySet v_value := { + field1 := "abcde", + field2 := omit + } + + if (match(v_value, mw_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_010()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_011.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea82c1ed1211957a996288750a8e6e389afda08d --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_011.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that matching a value expression against a template instance which evaluates to the omit matching mechanism shall return false. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_011 { + +type component GeneralComp { } + +type set MySet { + charstring field1, + boolean field2 optional +} + +template MySet mw_receiveTemplate := { + field1 := pattern "ab*de", + field2 := omit +} + +testcase TC_Sem_1509_MatchOperation_011() runs on GeneralComp { + var MySet v_value := { + field1 := "abcde", + field2 := true + } + + if (match(v_value, mw_receiveTemplate)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_011()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_012.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c9abfd25268981c880cfeeeb6ce01330ef27cf75 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_012.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that if the expression-parameter evaluates to a literal value without explicit or implicit identification of its type, the type of the template instance-parameter shall be used as the type governor for the expression-parameter. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// Restriction C: If the expression-parameter evaluates to a literal value without explicit or implicit identification of its type, the type of the template instance-parameter shall be used as the type governor for the expression-parameter. + + +module Sem_1509_MatchOperation_012 { + +type component GeneralComp { } + +template integer m_lessThan10 := (-infinity..9); + +testcase TC_Sem_1509_MatchOperation_012() runs on GeneralComp { + + if (match(-20, m_lessThan10)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_012()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23382b7bfc6aac100983784aad1bd0b8155211c4 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_013.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that if the expression-parameter evaluates to a literal value without explicit or implicit identification of its type, the type of the template instance-parameter shall be used as the type governor for the expression-parameter. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// Restriction C: If the expression-parameter evaluates to a literal value without explicit or implicit identification of its type, the type of the template instance-parameter shall be used as the type governor for the expression-parameter. + + +module Sem_1509_MatchOperation_013 { + +type component GeneralComp { } + +const integer c_value := 1; + +testcase TC_Sem_1509_MatchOperation_013() runs on GeneralComp { + + if (match(c_value,*)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_013()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_014.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3472a035c8b53bba24e2f19cfd69f31c8d99fe1d --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_014.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly with enums. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_014 { + +type component GeneralComp { } + +type enumerated A_enum { A, B, C, D, E }; +type enumerated B_enum { A, F, G }; + +testcase TC_Sem_1509_MatchOperation_014() runs on GeneralComp { + + var A_enum v_value := A; + + + if (match(v_value, B_enum:G)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_014()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_015.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd96ceaf40a5870fbce75f95135adba1dc2d5591 --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_015.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly with enums. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_015 { + +type component GeneralComp { } + +type enumerated A_enum { A, B, C, D, E }; +type enumerated B_enum { A, F, G }; + +testcase TC_Sem_1509_MatchOperation_015() runs on GeneralComp { + + var A_enum v_value := A; + + + if (match(A,v_value)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_015()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_016.ttcn b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9aaf8669efc34d78bfb4f937a89b0f1514dcd3ab --- /dev/null +++ b/ATS/core_language/15_templates/1509_match_operation/Sem_1509_MatchOperation_016.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15.9, Ensure that the match operation works correctly with enums. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1509_MatchOperation_016 { + +type component GeneralComp { } + +type enumerated A_enum { A, B, C, D, E }; +type enumerated B_enum { A, F, G }; + +testcase TC_Sem_1509_MatchOperation_016() runs on GeneralComp { + + var A_enum v_value := A; + + + if (match(B,v_value)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1509_MatchOperation_016()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NOTES b/ATS/core_language/15_templates/1510_valueof_operation/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..f1ddf69e38248aa5054375c978ebe03b652e450a --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NOTES @@ -0,0 +1 @@ +- NOTE: This could be extended to cover any kinds of types etc. We keep this simple. \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_001.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a50103aad374976cb16184c5f3a0dab7d37a614 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_001.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.10, Ensure that the valueof function works correctly on omit. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1510_ValueOfOperation_001 { + +type component GeneralComp { } + +testcase TC_NegSem_1510_ValueOfOperation_001() runs on GeneralComp { + var template integer m_int := omit; + var integer v_int := valueof(m_int); + + // if we get here, something must be wrong as valueof on m_int shall cause an error + // due to the omit. + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_002.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0cd54aa354df1ba3e9a2c5568f9faa406c384201 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.10, Ensure that the valueof function works correctly on templates with wildcards. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1510_ValueOfOperation_002 { + +type component GeneralComp { } + +type record ExampleType { + integer field1, + boolean field2 +} + +template ExampleType m_template := { + field1 := *, + field2 := ? +} + +testcase TC_NegSem_1510_ValueOfOperation_002() runs on GeneralComp { + var ExampleType v_int := valueof(m_template); + + // if we get here, something must be wrong as valueof on m_template shall cause an error + // due to the * and ? wildcards. + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_003.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1be285b3400294e7d0e85cedc9a5e96a05cc8c36 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.10, Ensure that the valueof function works correctly on regular value templates. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1510_ValueOfOperation_003 { + +type component GeneralComp { } + +type record ExampleType { + integer field1, + boolean field2 +} + +testcase TC_NegSem_1510_ValueOfOperation_003() runs on GeneralComp { + var template ExampleType f_first := { + field1 := (1, 2), + field2 := true + }; + + var ExampleType v_second := valueof(f_first); + + // if we get here, something must be wrong as valueof on m_template shall cause an error + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_004.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06fad54d913d4718961c34d0aedf23516f58daf7 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_004.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.10, Ensure that the valueof function works correctly on range templates. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1510_ValueOfOperation_004 { + +type component GeneralComp { } + +testcase TC_NegSem_1510_ValueOfOperation_004() runs on GeneralComp { + var template integer v_test := (1..5); + + var integer v_second := valueof(v_test); + + // if we get here, something must be wrong as valueof on v_test shall cause an error + // as it is not a template. + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_005.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a072eab78bdfbfa2b56648820c1a57f6dd3fe087 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_005.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.10, check that runtime error occurs if valueof is applied to uninitialized template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The template shall be completely initialized and resolve to a specific value. + +module NegSem_1510_ValueOfOperation_005 { + +type component GeneralComp { } + +testcase TC_NegSem_1510_ValueOfOperation_005() runs on GeneralComp { + var template integer v_test; + + var integer v_second := valueof(v_test); + + // if we get here, something must be wrong as valueof on v_test shall cause an error + // as it is not a template. + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_005()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_006.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26ec3cc793474c861fdd896011367b0741a6392c --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/NegSem_1510_ValueOfOperation_006.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15.10, check that runtime error occurs if valueof is applied to partially initialized template + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The template shall be completely initialized and resolve to a specific value. + +module NegSem_1510_ValueOfOperation_006 { + +type component GeneralComp { } + +type record R { + integer field1, + integer field2 +} + +testcase TC_NegSem_1510_ValueOfOperation_006() runs on GeneralComp { + var template R v_test; + var R v_result; + v_test.field1 := 1; // field2 is left uninitialized + v_result := valueof(v_test); + + // if we get here, something must be wrong as valueof on v_test shall cause an error + // as it is not a template. + setverdict(fail); +} + +control{ + execute(TC_NegSem_1510_ValueOfOperation_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1510_valueof_operation/Sem_1510_ValueOfOperation_001.ttcn b/ATS/core_language/15_templates/1510_valueof_operation/Sem_1510_ValueOfOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72508240aa7d460e5e4b625e62fc810a11932ed2 --- /dev/null +++ b/ATS/core_language/15_templates/1510_valueof_operation/Sem_1510_ValueOfOperation_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15.10, Ensure that the valueof operation works as expected for fully initialized templates. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1510_ValueOfOperation_001 { + +type component GeneralComp { } + +type record ExampleType { + integer field1, + boolean field2 +} + +template ExampleType m_template := { + field1 := 1, + field2 := true +} + +testcase TC_Sem_1510_ValueOfOperation_001() runs on GeneralComp { + var ExampleType v_value := valueof(m_template); + + if (match(v_value.field1, 1) and + match(v_value.field2, true) + ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1510_ValueOfOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..067e60fb4ac054542bbc025fc9b397f8e654adba --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types yields an even number of digits. + ** @verdict pass reject + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001 { + +type component GeneralComp { } + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001() runs on GeneralComp { + var template octetstring v_str := 'ABCD'O & '?'O & '?E'O; + + // shall cause an error as it would denote 9 (i.e., uneven) number of digits + setverdict(fail); +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bb80eabf9553791197aec4373a82de8b9d1dc1e --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of strings types yields an error if specified ranges are not fixed length. + ** @verdict pass reject + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002 { + +type component GeneralComp { } + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002() runs on GeneralComp { + var template octetstring v_str := 'ABCD'O & * length(1..2) & pattern 'EE?FF'; + + // shall cause an error as the length attribute should be of fixed length + setverdict(fail); +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0044636f66f7dc53456307086555dcd5b7a38ec --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that a simple concatenation of non-wildcard octetstring must not yield in a non-even number of hexadecimals. + ** @verdict pass reject + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003 { + +type component GeneralComp { } + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003() runs on GeneralComp { + var template octetstring v_str := 'AB'O & '0F'O & '2A'O & 'F'O; + + // shall cause an error as the length of the concantenated octetstring is is uneven + setverdict(fail); +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7873088419d567740e04e6ec721f5e7a3c408413 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that the inline template definitions are correctly concatenated. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + charstring field2 +} + +template MyRecord m_receiveTemplate := { + field1 := pattern "AB*DE", + field2 := "ABCC" & * & "EF" //only specific values allowed when there is no pattern keyword +} + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004() runs on GeneralComp { + var MyRecord v_value := { + field1 := "AB*DE", + field2 := "ABCCDE*EF" + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62cc70403ad71fc2af651ce0e8d769e5a2283f5f --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that the inline template definitions are correctly concatenated. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + charstring field2 +} + +template MyRecord m_receiveTemplate := { + field1 := pattern "AB*DE", + field2 := pattern "ABCC" & * length(2) & "EF" //cannot use length(n) attribute on charstring pattern +} + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005() runs on GeneralComp { + var MyRecord v_value := { + field1 := "AB*DE", + field2 := "ABCCDE*EF" + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_005()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f825232161e1722661552f24556814822a62814 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types and ? patterns works as expected. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006 { + +type component GeneralComp { } + +testcase TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006() runs on GeneralComp { + var template octetstring v_myString1 := 'ABCD'O & ? length(2) length (6); //missing parenthesis + if (match('ABCD12'O, v_myString1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1511_ConcatenatingTemplatesOfStringAndListTypes_006()); +} + +} diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8346e703b3f8bccba7bce98bf19677141911e31 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of charstring types works as expected (variant 1). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001() runs on GeneralComp { + var template charstring v_myChar1 := pattern "ABC" & "D" & "*" & "E?F"; + if (match("ABCD2E1F", v_myChar1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74d39f0004abd7d1600d8991eee4a399a7617085 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types works as expected (variant 2). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002() runs on GeneralComp { + var template octetstring v_myString1 := 'ABCC'O & * length(1) & 'EF'O; + if (match('ABCC22EF'O,v_myString1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce97f66dfb110d2ad63efff5b7ca5abc1d5e89d8 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of bitstring types works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003() runs on GeneralComp { + var template bitstring v_myBitStr := '010'B & '*'B & '1?1'B; + + if (match('010010101101'B, v_myBitStr)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3abf3259838f36adc79c890e08bcd47cdf10a9ce --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types works as expected (variant 1). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004() runs on GeneralComp { + var template octetstring v_str := 'ABCD'O & 'AB*'O & 'EF'O; + + if (match('ABCDABEF'O, v_str)) { //matching not present values + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17de02df59296172a1b547597e30ca2d9af3af0f --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types works as expected (variant 2). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005() runs on GeneralComp { + var template octetstring v_template := 'ABCD'O & '??'O & 'EF'O; + + if (match('ABCDAABBEF'O, v_template)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_005()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b70c7df51c1047193eb3cdb699bb13a7109f5157 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that a concatenation of charstrings with a fixed length AnyValueOrNone be matched. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006() runs on GeneralComp { + var template charstring m_str := pattern "ABC?#3" & "E?F"; //equivalent to ABC???E?F pattern + + if (match("ABCXYZE2F", m_str)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62e9e2918f08659c204a64d4aac16b7de2f0d434 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.2 + ** @purpose 1:15.11, Ensure that concatenations of record of charstrings are accepted. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007 { + +type component GeneralComp { } + +type record of charstring RecOfChar; + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007() runs on GeneralComp { + var template RecOfChar m_concatenation := {"ABC"} & {pattern "D*", pattern "E?" & "F"}; + + var RecOfChar m_reference := {"ABC","D213","E2F"}; // some value that matches + + if (match(m_reference,m_concatenation)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_007()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9ccde7a48e717d5757b13d6e003b3a6a9da035b --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenations of record of charstrings work when parameterized. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008 { + +type component GeneralComp { } + +type record of charstring RecOfChar; + +template RecOfChar m_concatenation := {"ABC"} & * length(3) & {pattern "E" & "?" & "F"}; + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008() runs on GeneralComp { + var RecOfChar m_reference := {"ABC","A","B","C","E2F"}; // some value that matches + + if (match(m_reference, m_concatenation)) { + setverdict(pass); + } else { + setverdict(fail); + } + +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_008()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ad6dd48e7b3240a6d709204cc338542eba2effd --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenations of set of integers are accepted. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009 { + +type component GeneralComp { } + +type set of integer SetOfInt; + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009() runs on GeneralComp { + var template SetOfInt m_concatenation := {1, 2} & * length(2) & {3, 4}; + + var SetOfInt m_reference := {1,2, 20, 21, 3, 4}; + if (match(m_reference,m_concatenation)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_009()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ad68a004952ef1f4aee48212694ab9147980609 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that the inline template definitions are correctly concatenated. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010 { + +type component GeneralComp { } + +type record MyRecord { + charstring field1, + charstring field2 +} + +template MyRecord m_receiveTemplate := { + field1 := pattern "ab*de", + field2 := "ABC" & "DE*" & "F?" //concatenation of literal characters +} + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010() runs on GeneralComp { + var MyRecord v_value := { + field1 := "ab*de", + field2 := "ABCDE1F1" + } + + if (match(v_value, m_receiveTemplate)) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_010()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e0b0fe89454e8266fe446a2c23c79b3f97fbd94 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types works as expected (matching patterns in quotation). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Note: see CR5805 regarding corresponding BNF update + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011() runs on GeneralComp { + var template octetstring v_myString1 := 'ABCC'O & 'DD*'O & 'EE?FF'O; + if (match('ABCCDD22EE11FF'O, v_myString1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_011()); +} + +} diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34ac0ff843fed09c0c1bee2b292d930ef9242ae1 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 451 and 470 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types and ? patterns works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012() runs on GeneralComp { + var template octetstring v_myString1 := 'AB'O & 'CD'O & ? & ? length(1) & 'EF'O; //results in 'ABCD*?EF'O + if (match('ABCD2233EF'O, v_myString1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_012()); +} + +} diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddbbbb7779ee4843781c045d37453fe662e81c30 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of octetstring types and ? patterns works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013() runs on GeneralComp { + var template octetstring v_myString1 := ('ABCD'O & ? length(2)) length (1..6); + // results in 'ABCD??'O matching an octet string of length 4 (8 hex digits) + if (match('ABCD1234'O, v_myString1)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_013()); +} + +} diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfd881d6b590692c0ad95234232d715c57f4ea89 --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:15.11, Ensure that concatenation of charstring and universal charsting types are concatenated as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +/* When templates of charstring and universal charstring type are both + * present in the concatenation, the charstring values are implicitly converted to universal charstring values*/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014 { + +type component GeneralComp { } + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014() runs on GeneralComp { + var template universal charstring v_myString1 := (char ( 0, 0, 1, 113) & "AB" & char ( 0, 0, 1, 112)); // "űABŰ" + + if (match("űABŰ", v_myString1)) { + setverdict(pass); + } else { + setverdict(fail,v_myString1); + } +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_014()); +} + +} diff --git a/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015.ttcn b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7428012f5e229a544b9f996cd0621832ccc30bce --- /dev/null +++ b/ATS/core_language/15_templates/1511_concatenating_templates_of_string_and_list_types/Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:15.11, Ensure that concatenations of record of charstrings work when parameterized. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015 { + +type component GeneralComp { } + +type record of charstring RecOfChar; + +template RecOfChar m_myRec_par(integer p_num) := {"ABC"} & ? & * length(p_num) & {"EF"}; + +testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015() runs on GeneralComp { + var integer v_int := 3; + var template RecOfChar v_recofChar; + v_recofChar :={ "ABC" } & { "Z" } & { "Z" } & { "Z" } & { "EF" }; + + if (match(valueof(v_recofChar), m_myRec_par(2))) { + setverdict(pass); + } else { + setverdict(fail); + } + +} + +control{ + execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_015()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_001.ttcn b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed8362c20c0fa6ad2f7f0787a74aa4eabcf2dd5f --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_001.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that a template formed from a union is rejected when the union somehow contains a default type field. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_15_TopLevel_001 { + +type record MyRecord { + default def +} + +type union MyUnion { + integer choice1, + MyRecord choice2 +} + +template MyUnion m_integerChosen := { + choice1 := 5 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_002.ttcn b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..df1f0eee9384921fa159abcf65083e375ee435e3 --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_002.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that a template formed from a union is rejected when the union somehow contains a port type field. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_15_TopLevel_002 { + +type port MyPort message {inout integer}; + +type record MyRecord { + MyPort myPort1 +} + +type union MyUnion { + integer choice1, + MyRecord choice2 +} + +template MyUnion m_integerChosen := { + choice1 := 5 +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_003.ttcn b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47c90ea979927d54d03dbdc8ac695b076cf5b86f --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_003.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that a template shall not be of default type. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_15_TopLevel_003 { + +type record MyRecord { + default def +} + +template MyRecord mw_myRecord := { + def := ? +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_004.ttcn b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6898ecfe6dc4fcb3f5d0e8eeb0396a187fbf3475 --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/NegSem_15_TopLevel_004.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that a template shall not be of port type. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_15_TopLevel_004 { + +type port MyPort message {inout integer}; + +type record MyRecord { + MyPort myPort1 +} + +template MyRecord mw_myRecord := { + myPort1 := ? +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/NegSyn_15_TopLevel_001.ttcn b/ATS/core_language/15_templates/15_toplevel/NegSyn_15_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1754222a6a8ec83d923d71c158ee809a3ccdecd7 --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/NegSyn_15_TopLevel_001.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that the expression or template body initializing a template shall evaluate to a value or template, which is type compatible with the template being declared. + ** @verdict pass reject, noexecution + *****************************************************************/ + +// The following requirement is tested: +//Restriction C: the expression or template body initializing a template shall evaluate to a value or template, which is type compatible with the template being declared. + +module NegSyn_15_TopLevel_001 { + + +type record MyRecord { + integer myInt +} + +template MyRecord mw_myRecord := { + myInt := 2.1 // error: incompatible type (int req., float is given) +} + +} \ No newline at end of file diff --git a/ATS/core_language/15_templates/15_toplevel/Syn_15_TopLevel_001.ttcn b/ATS/core_language/15_templates/15_toplevel/Syn_15_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdb933be4e95f65218daa1dac855377e17d5eea9 --- /dev/null +++ b/ATS/core_language/15_templates/15_toplevel/Syn_15_TopLevel_001.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:15, Ensure that a simple template with a single charstring field is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_15_TopLevel_001 { + +type record MyRecord { + charstring field1 +} + +template MyRecord m_myTemplate := { + field1 := "Hello World!" +} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160101_invoking_functions/Sem_160101_invoking_functions_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160101_invoking_functions/Sem_160101_invoking_functions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..090742be796bfb3be75eb546372f94667dc236ca --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160101_invoking_functions/Sem_160101_invoking_functions_001.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.1, Ensure that the IUT correctly handles function invocations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160101_invoking_functions_001 { + + +type component GeneralComp { + var integer v_gc:=0; +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + v_gc:=v_gc+p_integer; + return v_gc; +} + +testcase TC_Sem_160101_invoking_functions_001 () runs on GeneralComp { + var integer v_result:=0; + + f_test(); + f_test(1); + v_result:=f_test(1); + if( match(v_result, 2) and match(f_test(), 2) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_Sem_160101_invoking_functions_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NOTES b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..0bfefe5b6a49f2410c099453eccd8c7e8a7b656c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NOTES @@ -0,0 +1,3 @@ +- NOTE: The proper functioning of encvalue and decvalue functions cannot be tested. +- TODO: split these tests in one per function (since if one function fails the entire test + fails and we could not say that the other functions work properly) \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..df3d8b1be86608c2792524a7bf55ce7a54aff917 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_001.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_001 { + + type component GeneralComp { + } + + testcase TC_NegSem_160102_predefined_functions_001 () runs on GeneralComp { + var charstring v_i; + + v_i:=int2char(128); + } + + control{ + execute(TC_NegSem_160102_predefined_functions_001()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f37b4717f3fe1610696ce020e774158dafded81 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_002.ttcn @@ -0,0 +1,21 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_002 { + + type component GeneralComp { + } + + testcase TC_NegSem_160102_predefined_functions_002 () runs on GeneralComp { + var charstring v_i; + + v_i:=int2char(-1); + } + + control { + execute(TC_NegSem_160102_predefined_functions_002()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14452fe946dfb1ef635963e1da7489959046d16b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_003.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_003 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_003 () runs on GeneralComp { + var universal charstring v_i; + + v_i:=int2char(2147483648); + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_003()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..416018a65ac6564db6cbd6fdf8eb8fb3f1393665 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_004.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_004 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_004 () runs on GeneralComp { + var hexstring v_i; + + v_i:=int2hex(256,2); //mismatch of string length + setverdict(pass); +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_004()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05c5b420e73274942e24d02f8df837e3db2bb6aa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_005.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_005 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_005 () runs on GeneralComp { + var integer v_i; + + v_i:=char2int("blabla"); //mismatch of string length + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_005()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..261bbfda12091f28a63776b9a76439b7fcdc4cce --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_006.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_006 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_006 () runs on GeneralComp { + var integer v_i; + + v_i:=lengthof('1*F'H); //undetermined string length + setverdict(pass); +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_006()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_007.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03f5d8e580a8bdcee9b1126748851714c604152a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_007.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_007 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_007 () runs on GeneralComp { + var integer v_i; + + v_i:=lengthof('1'B length(3)); //undetermined string length + setverdict(pass); +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_007()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_008.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83d445a1d8486711db86f868b4220b40b9685ad0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_008.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_008 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_008 () runs on GeneralComp { + var integer v_i; + + v_i:=lengthof('1*0'B length(3..6)); //undetermined string length + setverdict(pass); +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_008()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_009.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32d111bc8b1b93f515c1af1e306af0afe0cb94e1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_009.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_009 { + type enumerated MyEnumeratedType {e_black, e_white}; + + type record MyRecord { + boolean field1, + record of integer field2, + integer field3, + MyEnumeratedType field4 optional + } + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_009 () runs on GeneralComp { + template MyRecord template1 := { true, { permutation(2, 3) }, * } + var integer v_i; + + v_i:=sizeof(template1); //undetermined record length + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_009()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_010.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3404fbb8c7e897c925d9445a5320e17b3694ae20 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_010.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_010 { + type record of integer IntegerList; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_010 () runs on GeneralComp { + template IntegerList template1 := { 1, 2, 3, * } length(1..2) ; //incorrect template length + var integer v_i; + + v_i:=lengthof(template1); + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_010()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_017.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38baf0645c9340910ebbba56f329dfe9f9a3ef0a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_017.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_017 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_017 () runs on GeneralComp { + var charstring v_example:="example text string"; + var charstring v_i; + + v_i:=regexp(v_example,charstring:"?+(text)?+",1); //wrong group index + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_017()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_018.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88bb6392f3bbb1c03c363b84ee4774f7a1b33cd3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_018.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_018 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_018 () runs on GeneralComp { + var charstring v_example:="example text string"; + var charstring v_i; + + v_i:=regexp(v_example,charstring:"?+(text)?+",-1); //wrong group index + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_018()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_019.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cbd9a2f91e93abb3ecd9d0c57a47a5df9b711c2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_019.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_019 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_019 () runs on GeneralComp { + var charstring v_example:="example text string"; + var charstring v_i; + + v_i:=regexp(v_example,charstring:"?+(text)?+"); //missing group index + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_019()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_021.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08db89f81ed52de378d28f31c2e6988555ea328b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_021.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_021 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_021 () runs on GeneralComp { + var charstring v_i; + + v_i:=substr('00100110'B,-3,4); //wrong index value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_021()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_022.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc14fd12579cf56e5869e28e2d65b30adda51fda --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_022.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_022 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_022 () runs on GeneralComp { + var charstring v_i; + + v_i:=substr('00100110'B,3,-4); //wrong length value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_022()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_023.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1491264550c077381cc1ace2a824ef68e91b91cb --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_023.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_023 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_023 () runs on GeneralComp { + var charstring v_i; + + v_i:=substr('00100110'B,3,14); //too large length value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_023()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_024.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9403619170b21e7659ad390dcba7b827ede0f638 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_024.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_024 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_024 () runs on GeneralComp { + var bitstring v_i; + + v_i:=replace('00000110'B,-1,3,'111'B); //wrong index value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_024()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_025.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de887e8dd39e3e074598cc35dbed16e032af8dc3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_025.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_025 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_025 () runs on GeneralComp { + var bitstring v_i; + + v_i:=replace('00000110'B,1,-3,'111'B); //wrong length value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_025()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_026.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe45e83e23eb652908415f2e7c0742c23f5b5973 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_026.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_026 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_026 () runs on GeneralComp { + var bitstring v_i; + + v_i:=replace('00000110'B,1,13,'111'B); //too large length value + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_026()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_027.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03812251b4a8f2b666cbe63a454d7777ffef3241 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_027.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_027 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_027 () runs on GeneralComp { + var bitstring v_i; + + v_i:=replace('00000110'B,1,4,'8'H); //incompatible replacement type + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_027()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_028.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fff8e1a57d6a9f951642eb2a04bdcaeaffeacdcc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_028.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_028 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + type enumerated Fruits {e_apple, e_peach, e_cherry}; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_028 () runs on GeneralComp { + + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_black; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_black := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow; + + + if( match(enum2int(e_black), 0) //ambiguous label + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_028()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_029.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38dfd4d5b8484206423b77fdfdf1c5df5e7b6220 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_029.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_029 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + type enumerated Fruits {e_apple, e_peach, e_cherry}; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_029 () runs on GeneralComp { + + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_black; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_black := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow; + + + if( match(enum2int(EnumeratedTypeWithLabels1.e_black), 0) //not allowed selection + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_029()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_030.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74a7b3751645174956b9654464e242bbc457a14a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_030.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_030 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + type enumerated Fruits {e_apple, e_peach, e_cherry}; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_030 () runs on GeneralComp { + + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_black; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_black := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow; + const EnumeratedTypeWithLabels1 c_enum1_black := e_black; + + + if( match(int2enum(4,vl_enum1_black), c_enum1_black) //not existing label + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_030()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_031.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f77749cced81d11c4abe1cf5a6d80b52d89c9296 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_031.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ +module NegSem_160102_predefined_functions_031 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_031 () runs on GeneralComp { + var float v_random1; + + v_random1:=rnd(infinity); //cannot have infinity as a seed + if( match(rnd(infinity), v_random1) and not match(rnd(1.0), v_random1) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_031()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_032.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a46fbb3a05658bdaca8f8b0db1336c2c1997a76 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_032.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that an error is generated when the parameter of the encvalue function contains a matching symbol + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// (C.5.1) When the actual parameter that is passed to inpar is a template, it shall resolve to +// a specific value (the same restrictions apply as for the argument of the send statement). + +module NegSem_160102_predefined_functions_032 { + +type integer I with { variant "32 bit"}; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_032 () runs on GeneralComp { + template I v_test := ?; + var bitstring v_res := encvalue(v_test); + setverdict(fail, "The previous encvalue call should have caused an error"); +} + +control{ + + execute(TC_NegSem_160102_predefined_functions_032()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_033.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2622e39aa36b22fb7313966b973d00fd48fbec0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_033.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that an error is detected when the parameter of the encvalue function contains an unitialized value + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// 16.1.2, restriction a.3: all actual in and inout parameters shall be initialized + +module NegSem_160102_predefined_functions_033 { + +type integer I with { variant "32 bit"}; + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_033 () runs on GeneralComp { + var template I v_test; + var bitstring v_res := encvalue(v_test); + setverdict(fail, "The previous encvalue call should have caused an error"); +} + +control{ + + execute(TC_NegSem_160102_predefined_functions_033()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_034.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15af2dd9290f733409cce3f150f91c84e6e993bc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_034.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that an error is detected when the parameter of the encvalue function contains a partially initialized value + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// 16.1.2, restriction a.3: all actual in and inout parameters shall be initialized + +module NegSem_160102_predefined_functions_034 { + +type record R +{ + integer field1, + integer field2 +} + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_034 () runs on GeneralComp { + template R v_test := { field1 := 1, field2 := - } + var bitstring v_res := encvalue(v_test); + setverdict(fail, "The previous encvalue call should have caused an error"); +} + +control{ + + execute(TC_NegSem_160102_predefined_functions_034()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c67f88a388a67a1432e3d75111c82dc86508bb33 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_036.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + *In addition to the general error causes in clause 16.1.2, error causes are: + * inpar is a template of a character string type and contains a matching mechanism other than AnyElement or +AnyElementsOrNone; */ + +module NegSem_160102_predefined_functions_036 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_036 () runs on GeneralComp { + + const charstring m_Ref:="abc?def?"; + var template charstring Mytemp := pattern "{m_Ref}\q{0,0,1,113}"; + var charstring v_i; + + v_i:=substr(Mytemp,1,2); //error: non allowed matching mechanism + + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_036()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f099e24a0d753bb8abb2b50695883898d7e98a49 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_037.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + *In addition to the general error causes in clause 16.1.2, error causes are: + * inpar is a template of a binary string or sequence type or array and it contains other matching mechanism as + * specific value and AnyElement; + */ + +module NegSem_160102_predefined_functions_037 { + +type component GeneralComp { +} + + +testcase TC_NegSem_160102_predefined_functions_037 () runs on GeneralComp { + + + var template bitstring Mytemp := '00101*'B; + var bitstring v_i; + + v_i:=substr(Mytemp,1,2); //error: contains a matching mechanism other than AnyElement + + + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_037()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6af64e27a2d75ce0f69c658b77e603abb32382dd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_038.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +/* The following requirements are tested: + *In addition to the general error causes in clause 16.1.2, error causes are: + * inpar is a template of a binary string or sequence type or array and it contains other matching mechanism as + * specific value and AnyElement; + */ + +module NegSem_160102_predefined_functions_038 { + +type component GeneralComp { +} + +type integer MyArrayType1[3]; +type record of integer MyRecof; + +testcase TC_NegSem_160102_predefined_functions_038 () runs on GeneralComp { + + + var template MyArrayType1 MyArray :={ 7, 8, * }; + + var template MyRecof v_i; + + v_i:=substr(MyArray,1,2); //error: contains a matching mechanism * + +} + + +control{ + + execute(TC_NegSem_160102_predefined_functions_038()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_039.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8be720949e5db0b84a0d5dea997d14720095e3e8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_039.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Ensure that integer value of an enum handled correctly + +module NegSem_160102_predefined_functions_039 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday(3..5) + }; + + testcase TC_NegSem_160102_predefined_functions_039() runs on GeneralComp { + var EDays v_enum := Friday(3); + int2enum(6,v_enum); // error: not allowed value + + if (match(enum2int(v_enum),6)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_160102_predefined_functions_039()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_040.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec2c89c73625228260a654ac0c60499850b5261b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/NegSem_160102_predefined_functions_040.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Ensure that integer value of an enum handled correctly + +module NegSem_160102_predefined_functions_040 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday(-1), Tuesday(1), Wednesday(2), Thursday(3), Friday(3..5) // error + }; + + testcase TC_NegSem_160102_predefined_functions_040() runs on GeneralComp { + var EDays v_enum := Wednesday; + int2enum(3,v_enum); // value already occupied + + if (match(enum2int(v_enum),2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_NegSem_160102_predefined_functions_040()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22dbb326402be4fb2194b7b902d30d80e359a5f6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_001.ttcn @@ -0,0 +1,69 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_001 { + type enumerated EnumeratedType {e_black, e_white}; + + type component GeneralComp { + } + + /** + * @desc Equals method for floats + * @return true if abs(f1 - f2) < 1.E-6 + */ + function f_isFloatNear(in float f1, in float f2) return boolean { + var float delta := f1-f2; + if (delta < 0.0) { + delta := 0.0 - delta; + } + return delta < 1E-6; + } + + testcase TC_Sem_160102_predefined_functions_001 () runs on GeneralComp { + const universal charstring c_i:="i"; + var integer v_result:=0; + var EnumeratedType v_enum:=e_white; + + if( match(int2char(105), "i") and + match(int2unichar(105), c_i) and + match(int2bit(5,4), '0101'B) and + match(int2hex(55,4), '0037'H) and + match(int2oct(55,2), '0037'O) and + match(int2str(55), "55") and + (f_isFloatNear(int2float(5),5.0)) and + match(float2int(5.0), 5) and + match(char2int("i"), 105) and + match(char2oct("i"), '69'O) and + match(unichar2int(c_i), 105) and + match(bit2int('101'B), 5) and + match(bit2hex('110111'B), '37'H) and + match(bit2oct('110111'B), '37'O) and + match(bit2str('110111'B), "110111") and + match(hex2int('37'H), 55) and + match(hex2bit('37'H),'00110111'B) and + match(hex2oct('37'H), '37'O) and + match(hex2str('37'H), "37") and + match(oct2int('37'O), 55) and + match(oct2bit('37'O), '00110111'B) and + match(oct2hex('37'O), '37'H) and + match(oct2str('37'O), "37") and + match(oct2char('69'O), "i") and + match(str2int("55"),55) and + match(str2oct("55"), '55'O) and + (f_isFloatNear(str2float("5.5"),5.5)) and + match(enum2int(v_enum), 1) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_001()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6d69994054719cfc05e0c4dfa07ec6f1965bf51b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_002.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_160102_predefined_functions_002 { + type record of integer IntegerList; + + type record MyRecord { + boolean field1, + record of integer field2, + integer field3 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_002 () runs on GeneralComp { + template MyRecord template1 := { + field1 := true, + field2 := { permutation(2, 3), ? }, + field3 := omit + } + template MyRecord template2 := { + field1 := true, + field2 := {permutation(2, 3)}, + field3 := omit + } + template IntegerList template3 := { 1, 2, 3, * } length(1..3) ; + + if (not (lengthof(charstring:"test") == 4)) { + setverdict(fail); + } + if (not (lengthof(universal charstring:"test") == 4)) { + setverdict(fail); + } + if (not (lengthof(bitstring:'010'B) == 3)) { + setverdict(fail); + } + if (not (lengthof(hexstring:'55'H) == 2)) { + setverdict(fail); + } + if (not (lengthof(octetstring:'55'O) == 1)) { + setverdict(fail); + } + if (not (lengthof(charstring:pattern "t??t") == 4)) { + setverdict(fail); + } + if (not (lengthof(bitstring:'1??1'B) == 4)) { + setverdict(fail); + } + if (not (lengthof(hexstring:'1*1'H length(8)) == 8)) { + setverdict(fail); + } + if (not (lengthof(octetstring:'00?FF'O length(3)) == 3)) { + setverdict(fail); + } + if (not (lengthof(octetstring:'AB?'O) == 2)) { + setverdict(fail); + } + if (not (lengthof(template1.field2) == 3)) { + setverdict(fail); + } + if (not (sizeof(template2) == 2)) { + setverdict(fail); + } + if (not (lengthof(template3) == 3)) { + setverdict(fail); + } + setverdict(pass); + } + + control { + execute(TC_Sem_160102_predefined_functions_002()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6d46170abd0a0616257bd0500eb635f3f7ac868b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_003.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_160102_predefined_functions_003 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type union U { integer f1, octetstring f2 } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_003 () runs on GeneralComp { + var MyRecord v_record1 := { + field1 := {innerField1 := omit, innerField2 := omit}, + field2 := 2, + field3 := 3, + field4 := omit + }; + var U v_U1 := {f1 := 1}; + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + template U template2 := {f2 := ?} + + if( match(ispresent(v_record1.field1), true) and + match(ispresent(v_record1.field4), false) and + match(ispresent(v_record1.field2), true) and + match(ispresent(template1.field1.innerField1), true) and + match(ischosen(v_U1.f1), true) and + match(ischosen(v_U1.f2), false) and + match(ischosen(template2.f2), true) and + match(ischosen(template2.f1), false) and + match(isvalue(template1.field2), true) and + match(isvalue(template2.f2), false) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_003()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fdd3538beb537a49524331327943292f86b6a2fd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_004.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_004 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_004 () runs on GeneralComp { + var charstring v_example:="example text string"; + + if( match(regexp(v_example,charstring:"?+(text)?+",0), "text") and //inline templates in this function are allowed by BNF 165. + match(regexp(v_example,charstring:"(?+)(text)(?+)",2), " string") and + match(regexp(v_example,charstring:"((?+)(text)(?+))",0), "example text string") and + match(substr('00100110'B,3,4), '0011'B) and + match(substr('ABCDEF'H,2,3), 'CDE'H) and + match(substr('01AB23CD'O,1,2), 'AB23'O) and + match(replace('00000110'B,1,3,'111'B), '01110110'B) and + match(replace('ABCDEF'H,0,2,'123'H), '123CDEF'H) and + match(replace('01AB23CD'O,2,1,'FF96'O), '01ABFF96CD'O) and + match(replace(v_example,0,7,"my"), "my text string") + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_004()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8b2703f9e8f7b0cb79c4823741bde6c35b33d03 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_005.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_005 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_005 () runs on GeneralComp { + var MyRecord v_record1 := { + field1 := {}, + field2 := 2, + field3 := 3, + field4 := omit + }; + var bitstring v_encoded; + var MyRecord v_decoded; + + v_encoded:=encvalue(v_record1); + if( match(decvalue(v_encoded,v_decoded), 0) and + match(v_record1,v_decoded) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } with { + optional "implicit omit"; + } + + control{ + execute(TC_Sem_160102_predefined_functions_005()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5162faa55bb4526d267093a1165a0efe48bc6e42 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_006.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_006 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_006 () runs on GeneralComp { + var float v_random1; + + v_random1:=rnd(0.0); + if( match(rnd(0.0), v_random1) and not match(rnd(1.0), v_random1) ) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_006()); + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_007.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f046c6294e7028df55c37c6514820e4ab129fd51 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_007.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_160102_predefined_functions_007 { + type enumerated MyEnumeratedType {e_black, e_white}; + type record of integer IntegerList; + + type record MyRecord { + boolean field1, + record of integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_007 () runs on GeneralComp { + template MyRecord template1 := { + field1 := true, + field2 := { permutation(2, 3), ? }, + field3 := 5, + field4 := omit + } + template MyRecord template2 := { + field1 := true, + field2 := {permutation(2, 3)}, + field3 := 6, + field4 := omit + } + template IntegerList template3 := { 1, 2, 3, * } length(1..3) ; + + if(lengthof(charstring : "test")!=4) { + setverdict(fail, "lengthof(charstring : ""test"")"); + } + if (lengthof(universal charstring : "test")!=4) { + setverdict(fail, "lengthof(universal charstring : ""test"")"); + } + if (lengthof('010'B)!=3) { // STF409: value definitions are interpreted as templates here + setverdict(fail, "lengthof('010'B)"); + } + if (lengthof('55'H)!=2) { // STF409: value definitions are interpreted as templates here + setverdict(fail, "lengthof('55'H)"); + } + if (lengthof('55'O)!=1) { // STF409: value definitions are interpreted as templates here + setverdict(fail, "lengthof('55'O)"); + } + if (lengthof(charstring : pattern "t??t")!=4) { + setverdict(fail, "lengthof(charstring : pattern ""t??t"")"); + } + if (lengthof(bitstring : '1??1'B)!=4) { + setverdict(fail, "lengthof(bitstring : '1??1'B)"); + } + if (lengthof(hexstring : '1*1'H length(8))!=8) { + setverdict(fail, "lengthof(hexstring : '1*1'H length(8))"); + } + if (lengthof(octetstring : '00?FF'O length(3))!=3) { + setverdict(fail, "lengthof(octetstring : '00?FF'O length(3))"); + } + if (lengthof(octetstring : 'AB?'O)!=2) { + setverdict(fail, "lengthof(octetstring : 'AB?'O)"); + } + if (sizeof(template1.field2)!=3) { + setverdict(fail, "sizeof(", template1.field2, ")"); + } + if (sizeof(template2.field2)!=2) { + setverdict(fail, "sizeof(", template2.field2, ")"); + } + if (lengthof(template3)!=3) { + setverdict(fail, "lengthof(", template3, ")"); + } + setverdict(pass); + } + + control{ + execute(TC_Sem_160102_predefined_functions_007()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_008.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31df498f4e77f5ad80b580343f5c421c96469a10 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_008.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_008 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_008 () runs on GeneralComp { + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + + if (ispresent(template1.field1.innerField2)) { // not present + setverdict(fail); + } else { + setverdict(pass); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_008()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_009.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6062cd74a557396f1d604e45c6cfa8f8e739233 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_009.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_009 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_009 () runs on GeneralComp { + template MyRecord template1 := { + field1 := {?, *}, + field2 := 2, + field3 := 3, + field4 := (e_black, e_white) ifpresent + } + + if (ispresent(template1.field4)) { // not present + setverdict(fail); + } else { + setverdict(pass); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_009()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_010.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fd46a8fded836530600242ce30a9479a2cbe5d9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_010.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// test enum2int predefined function with labels + +module Sem_160102_predefined_functions_010 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_010 () runs on GeneralComp { + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_black; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_white; + + if( match(enum2int(vl_enum_black), 0) and + match(enum2int(vl_enum_white), 1) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 0"); + } + + if( match(enum2int(vl_enum1_black), 1) and + match(enum2int(vl_enum1_white), 0) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 1"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_010()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_011.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ec9a2aa0b8a44f5ad5725bad88c500f29e7d14c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_011.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_011 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_011 () runs on GeneralComp { + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_black := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_black := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_black; + + const EnumeratedType c_enum_black := e_black; + const EnumeratedType c_enum_white := e_white; + const EnumeratedTypeWithLabels1 c_enum1_black := e_black; + const EnumeratedTypeWithLabels1 c_enum1_white := e_white; + const EnumeratedTypeWithLabels2 c_enum2_black := e_black; + const EnumeratedTypeWithLabels2 c_enum2_white := e_white; + const EnumeratedTypeWithLabels3 c_enum3_black := e_black; + const EnumeratedTypeWithLabels3 c_enum3_white := e_white; + + int2enum(0,vl_enum_black); + int2enum(1,vl_enum_white); + if( match(vl_enum_black, c_enum_black) and + match(vl_enum_white, c_enum_white) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 0"); + } + + int2enum(1,vl_enum1_black); + int2enum(0,vl_enum1_white); + if( match(vl_enum1_black, c_enum1_black) and + match(vl_enum1_white, c_enum1_white) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 1"); + } + + int2enum(-1,vl_enum2_black); + int2enum(0,vl_enum2_white); + if( match(vl_enum2_black, c_enum2_black) and + match(vl_enum2_white, c_enum2_white) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 2"); + } + + int2enum(-1,vl_enum3_black); + int2enum(1,vl_enum3_white); + if( match(vl_enum3_black, c_enum3_black) and + match(vl_enum3_white, c_enum3_white) + ) { + setverdict(pass); + } + else { + setverdict(fail, "fail 3"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_011()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_012.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a80bcdab012dbd1102bfc28a73dd2d10074b17d4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_012.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_012 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (-1), e_red (1), e_white(0) , e_yellow }; //e_yellow is 2 + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_012 () runs on GeneralComp { + var EnumeratedType vl_enum_black := e_black; + var EnumeratedType vl_enum_white := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_red := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_yellow := e_black; + + const EnumeratedType c_enum_black := e_black; + const EnumeratedType c_enum_white := e_white; + const EnumeratedTypeWithLabels1 c_enum1_red := e_red; + const EnumeratedTypeWithLabels1 c_enum1_yellow := e_yellow; + + int2enum(1,vl_enum1_red); + int2enum(2,vl_enum1_yellow); + + setverdict(pass); + + if (vl_enum1_red != c_enum1_red) { + setverdict(fail, "cannot decode e_red"); + } + + if (vl_enum1_yellow != c_enum1_yellow) { + setverdict(fail, "cannot decode e_yellow"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_012()); + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_013.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f8495d5d8bd8bed04ae77b56f66e958c14e7f3d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_013.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// test enum2int with labels +module Sem_160102_predefined_functions_013 { + + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_013 () runs on GeneralComp { + var EnumeratedTypeWithLabels2 vl_enum2_black := e_black; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_black := e_black; + var EnumeratedTypeWithLabels3 vl_enum3_white := e_white; + var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow; + + if( match(enum2int(vl_enum2_black), -1) and + match(enum2int(vl_enum2_white), 0) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + if( match(enum2int(vl_enum3_black), -1) and + match(enum2int(vl_enum3_white), 1) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_014.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..af8c3b333931bfa9b8fac348e5c8e67340ae27e9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_014.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_014 { + + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_014 () runs on GeneralComp { + var EnumeratedTypeWithLabels1 vl_enum1_black := e_white; + var EnumeratedTypeWithLabels1 vl_enum1_white := e_black; + + const EnumeratedTypeWithLabels1 c_enum1_black := e_black; + const EnumeratedTypeWithLabels1 c_enum1_white := e_white; + + int2enum(1,vl_enum1_black); + int2enum(0,vl_enum1_white); + if( match(vl_enum1_black, c_enum1_black) and + match(vl_enum1_white, c_enum1_white) + ) { + setverdict(pass); + } + else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_014()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_015.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac8530279c073f12efeac0cc5e5da21209b24884 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_015.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_015 { + type enumerated EnumeratedType {e_black, e_white}; + type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white}; + type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white}; + type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) }; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_015 () runs on GeneralComp { + var EnumeratedTypeWithLabels2 vl_enum2_black := e_white; + var EnumeratedTypeWithLabels2 vl_enum2_white := e_black; + + const EnumeratedTypeWithLabels2 c_enum2_black := e_black; + const EnumeratedTypeWithLabels2 c_enum2_white := e_white; + + int2enum(-1, vl_enum2_black); + int2enum(0, vl_enum2_white); + + setverdict(pass, "Both enumerated values matched"); + + if (vl_enum2_black != c_enum2_black) { + setverdict(fail, "black enumerated value not matching ", vl_enum2_black, c_enum2_black); + } + if (vl_enum2_white != c_enum2_white) { + setverdict(fail, "black enumerated value not matching ", vl_enum2_white, c_enum2_white); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_015()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_016.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05710dee5e10c1adb4223a1ebda781791482de90 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_016.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue function works correctly (as specified in Annex C.5.1) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// (C.5.1) The encvalue function encodes a value or template into a bitstring. When the actual +// parameter that is passed to inpar is a template, it shall resolve to a specific value (the +// same restrictions apply as for the argument of the send statement). The returned bitstring +// represents the encoded value of inpar, however, the TTCN-3 test system need not make any +// check on its correctness. + +module Sem_160102_predefined_functions_016 { + type integer I with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_016 () runs on GeneralComp { + var template I v_test := 0; + var bitstring v_res := encvalue(v_test); + if (lengthof(v_res) == 32) { + setverdict(pass); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_016()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_017.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..675f8f08e4664f79b26d607557ebf59f9a955cdd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_017.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue function performs full decoding correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// (C.5.2) +// The decvalue function decodes a bitstring into a value. The test system shall suppose that +// the bitstring encoded_value represents an encoded instance of the actual type of decoded_value. +// If the decoding was successful, then the used bits are removed from the parameter encoded_value, +// the rest is returned (in the parameter encoded_value), and the decoded value is returned +// in the parameter decoded_value. The function shall return an integer value to indicate success +// or failure of the decoding below: +// • The return value 0 indicates that decoding was successful. + +module Sem_160102_predefined_functions_017 { + type integer I with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_017 () runs on GeneralComp { + var bitstring v_test := int2bit(0, 32); + var I v_decoded; + var integer v_res := decvalue(v_test, v_decoded); + // expected result: + // v_res: 0 (success) + // v_decoded: 0 + // v_test: ''B (fully decoded) + if (match(v_res, 0) and match(v_decoded, 0) and match(lengthof(v_test), 0)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_017()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_018.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53c5acbbc9ca4a9df110702083e10ec5d70fa3f8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_018.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue function performs decoding if there are more bits than needed + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// (C.5.2) +// The decvalue function decodes a bitstring into a value. The test system shall suppose that +// the bitstring encoded_value represents an encoded instance of the actual type of decoded_value. +// If the decoding was successful, then the used bits are removed from the parameter encoded_value, +// the rest is returned (in the parameter encoded_value), and the decoded value is returned +// in the parameter decoded_value. The function shall return an integer value to indicate success +// or failure of the decoding below: +// • The return value 0 indicates that decoding was successful. + +module Sem_160102_predefined_functions_018 { + type integer I with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_018 () runs on GeneralComp { + const bitstring c_suffix := '11111111'B; + var bitstring v_test := int2bit(0, 32) & c_suffix; // 8 excess bits + var I v_decoded; + var integer v_res := decvalue(v_test, v_decoded); + // expected result: + // v_res: 0 (success) + // v_decoded: 0 + // v_test: '11111111'B (8 excess bits shall be returned) + if (match(v_res, 0) and match(v_decoded, 0) and match(v_test, c_suffix)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_018()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_019.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2cf9c7ce97cf3a88e0c86eef10385e05723cfad4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_019.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue function works properly in case of decoding failure + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// (C.5.2) +// The decvalue function decodes a bitstring into a value. The test system shall suppose that +// the bitstring encoded_value represents an encoded instance of the actual type of decoded_value. +// If the decoding was unsuccessful, the actual parameters for encoded_value and decoded_value are +// not changed. The function shall return an integer value to indicate success or failure of the +// decoding below: +// • The return value 1 indicates an unspecified cause of decoding failure. + +module Sem_160102_predefined_functions_019 { + type enumerated E { one(1), two(2), three(3) } with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_019 () runs on GeneralComp { + var bitstring v_test := int2bit(0, 32); + var E v_decoded; + var integer v_res := decvalue(v_test, v_decoded); + // expected result: + // v_res: 1 (failure, unspecified) -> no named value corresponding to ordinal number 0 + // v_decoded: uninitialized + // v_test: original 32-bit value + if (match(v_res, 1) and not isbound(v_decoded) and match(lengthof(v_test), 32)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_019()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_020.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1029dd31d8f6086994e7e1d547af16cb49d53f2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_020.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue function works properly in case of not enough bits + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// (C.5.2) +// The decvalue function decodes a bitstring into a value. The test system shall suppose that +// the bitstring encoded_value represents an encoded instance of the actual type of decoded_value. +// If the decoding was unsuccessful, the actual parameters for encoded_value and decoded_value are +// not changed. The function shall return an integer value to indicate success or failure of the +// decoding below: +// The return value 2 indicates that decoding could not be completed as encoded_value did not +// contain enough bits. + +module Sem_160102_predefined_functions_020 { + type integer I with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_020 () runs on GeneralComp { + var bitstring v_test := int2bit(0, 16); + var I v_decoded; + var integer v_res := decvalue(v_test, v_decoded); + // expected result: + // v_res: 2 (failed, not enough bits) -> there are only 16 bits available, while 32 is needed + // v_decoded: uninitialized + // v_test: original 16-bit value + if (match(v_res, 2) and not isbound(v_decoded) and match(lengthof(v_test), 16)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_020()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_021.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe24722da45ccf75b7782c6237156817a761a143 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_021.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_021 { + type enumerated MyEnumeratedType {e_black, e_white, e_green}; + + type record MyRecord { + record { + boolean innerField1 optional, + integer innerField2 optional + } field1 optional, + integer field2, + integer field3, + MyEnumeratedType field4 optional + } + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_021 () runs on GeneralComp { + var MyRecord v_record1 := { field1 := omit, field2 := 2, field3 := 3, field4 := omit } ; + var boolean v_i; + + v_i:=ispresent(v_record1.field1.innerField1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + + control{ + + execute(TC_Sem_160102_predefined_functions_021()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_022.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa1b2910087e8e09e20fd5e125529fb722e08a01 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_022.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_022 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_160102_predefined_functions_022 () runs on GeneralComp { + template U template1 := ?; + var boolean v_i; + + v_i:=ischosen(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_160102_predefined_functions_022()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_023.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08738b1a642f46805e3a79cd5748dea335847786 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_023.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_023 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_160102_predefined_functions_023 () runs on GeneralComp { + template U template1 := ({ f1 := 2 }, {f2 := 'AB'O }); + var boolean v_i; + + v_i:=ischosen(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_160102_predefined_functions_023()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_024.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1341f57b8c8005a90c2f604076b65e809cf0866 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_024.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_024 { + type union U { + integer f1, + octetstring f2 + } + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_024() runs on GeneralComp { + template U template1 := {f2 := ?} + var boolean v_i; + + v_i := isvalue(template1.f1); //function returns false value + if(v_i==false) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_024()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_025.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c666874054ab0be6ab4c667c40d5bc11622f2cd3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_025.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.33) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160102_predefined_functions_025 { + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_025 () runs on GeneralComp { + var charstring v_example:="example text string"; + var charstring v_i; + + v_i:=regexp(v_example,universal charstring: "?+(text)?+",0); //works according to resolution of CR 6424 + if(v_i=="text") { + setverdict(pass); + } else { + setverdict(fail, "Unexpected matching result"); + } + } + + + control{ + + execute(TC_Sem_160102_predefined_functions_025()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acb7acdb871f45ac90f57e43ec565bfaae907864 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_026.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts a universal charstring value to an octetstring.*/ + + +module Sem_160102_predefined_functions_026 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_026 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC123abc"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0); //string_encoding parameter is omitted, the default value "UTF-8", expected value: '414243313233616263'O + var octetstring v_1 := '414243313233616263'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_026()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51e239eed20c5a7268e28528e08b79e5a5e59559 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_027.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-8 universal charstring value to an octetstring.*/ + + +module Sem_160102_predefined_functions_027 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_027 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC123abc"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0,"UTF-8"); //"UTF-8", expected value: '414243313233616263'O + var octetstring v_1 := '414243313233616263'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_027()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd3a2eb53ed43085147614897fbd6112e4d5359f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_028.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-16 universal charstring value to an octetstring.*/ + +module Sem_160102_predefined_functions_028 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_028 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC123abc"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0,"UTF-16"); //"UTF-16", expected value: '0041 0042 0043 0031 0032 0033 0061 0062 0063'O + var octetstring v_1 := '004100420043003100320033006100620063'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_028()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..144ebffd91cd8c716cb226a0900ae51243a31884 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_029.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-32 universal charstring value to an octetstring.*/ + +module Sem_160102_predefined_functions_029 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_029 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC123abc"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0,"UTF-32"); //"UTF-32", expected value: '0000 0041 0000 0042 0000 0043 0000 0031 0000 0032 0000 0033 0000 0061 0000 0062 0000 0063'O + var octetstring v_1 := '000000410000004200000043000000310000003200000033000000610000006200000063'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_029()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_030.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cfb7e46c714be4e9146484d023a08fcee2fe53e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_030.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-16 universal charstring value to a Little endian octetstring.*/ + +module Sem_160102_predefined_functions_030 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_030 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0, "UTF-16LE"); //"UTF-16" little endian, expected value:'4100 4200 4300'O; + var octetstring v_1 := '410042004300'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_030()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_031.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3525778f85e80e4cafb847136e2225ae9a025d3c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_031.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-32 universal charstring value to a Little endian octetstring.*/ + +module Sem_160102_predefined_functions_031 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_031 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "ABC"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0, "UTF-32LE"); //"UTF-32" little endian, expected value:'4100 0000 4200 0000 4300 0000'O + var octetstring v_1 := '410000004200000043000000'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_031()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_032.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fc50b64e493bf7b20a6562f32446f92c9f672a4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_032.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-16 universal charstring value to a Big endian octetstring.*/ + +module Sem_160102_predefined_functions_032 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_032 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "AB"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0, "UTF-16BE"); //"UTF-16" Big endian, expected value:'00410042'O; + var octetstring v_1 := '00410042'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_032()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_033.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59337dc3587cab006199ae3742c89c93fecb1164 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_033.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an UTF-32 universal charstring value to a Big endian octetstring.*/ + +module Sem_160102_predefined_functions_033 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_033 () runs on GeneralComp { + + // universal charstring: + var universal charstring v_0 := "AB"; + + // predefined function for universal charstring to octetstring conversion: + var octetstring v_encoded := unichar2oct(v_0, "UTF-32BE"); //"UTF-32" Big endian, expected value:'00 00 00 41 00 00 00 42'O + var octetstring v_1 := '0000004100000042'O; + + + if( match(v_encoded,v_1) + ) { + setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded); + } + else { + setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_033()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82e62fcfabb2aac251c7fa9b7ec1b422925456f6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_034.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to universal charstring.*/ + + +module Sem_160102_predefined_functions_034 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_034 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '414243313233616263'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0); //expected value: ABC123abc + var universal charstring v_1 := "ABC123abc"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_034()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9de0a15a594bcf4a058b437fb8b0527fa208f7e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_035.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-8 encoded universal charstring.*/ + + +module Sem_160102_predefined_functions_035 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_035 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '414243'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0,"UTF-8"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_035()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2c6a9ce048209e54bef3284e9492cc92536d035 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_036.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-16 encoded universal charstring.*/ + + +module Sem_160102_predefined_functions_036 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_036 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '004100420043'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0,"UTF-16"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_036()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c1cdb76c82061134226822be4d9536ee3d89c3e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_037.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-32 encoded universal charstring.*/ + + +module Sem_160102_predefined_functions_037 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_037 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '000000410000004200000043'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0,"UTF-32"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_037()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_038.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c7c588d76c898192277f918a0c06c81862e8880 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_038.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-16 Little Endian byte order universal charstring.*/ + + +module Sem_160102_predefined_functions_038 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_038 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '410042004300'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0, "UTF-16LE"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ", v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_038()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_039.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..345cd2a7d2c5943ffa011a0d4c6c5ba941d0b44f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_039.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-32 Little Endian byte order universal charstring.*/ + + +module Sem_160102_predefined_functions_039 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_039 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '410000004200000043000000'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0, "UTF-32LE"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ", v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_039()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_040.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd27a0036e10bd82aa1491cc5a2143ca4e06dca9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_040.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-16 Big Endian byte order universal charstring.*/ + + +module Sem_160102_predefined_functions_040 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_040 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '004100420043'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0, "UTF-16BE"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ", v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_040()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_041.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73a616905e26b87d7ec28cf3ab6f1fe1606e4ca9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_041.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * This function converts an octetstring to an UTF-32 Big Endian byte order universal charstring.*/ + + +module Sem_160102_predefined_functions_041 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_041 () runs on GeneralComp { + + //octetstring: + var octetstring v_0 := '000000410000004200000043'O; + + // predefined function for universal charstring to octetstring conversion: + var universal charstring v_decode := oct2unichar(v_0, "UTF-32BE"); //expected value: ABC + var universal charstring v_1 := "ABC"; + + if( match(v_decode,v_1) + ) { + setverdict(pass,"Decoded value for: ", v_0, " is ", v_decode); + } + else { + setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_041()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e4112c9a82f8e4bce4c98f4309e074e3ae4bab1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_042.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function any2unistr, + * the invalue parameter of the any2unistr function may be uninitialized or partially initialized; +*/ + +module Sem_160102_predefined_functions_042 { + + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_042 () runs on GeneralComp { + + + var integer v_0 := 100; //integer with value + + + //integer with value + if( match(any2unistr(v_0),"100")) { setverdict(pass,"Result: ",any2unistr(v_0));} + else{setverdict(fail,"Result is: ",any2unistr(v_0), " Expected: 100");} + + } + + control{ + execute(TC_Sem_160102_predefined_functions_042()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf724db630751c9dbcaa18b1ce562cace126f8aa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_043.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function any2unistr, + * the invalue parameter of the any2unistr function may be uninitialized or partially initialized; +*/ + +module Sem_160102_predefined_functions_043 { + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_043 () runs on GeneralComp { + + var integer v_1; //uninitialized value + + //uninitialized value + if( match(any2unistr(v_1),"UNINITIALIZED")) { setverdict(pass,"Result: ",any2unistr(v_1));} + else{setverdict(fail,"Result is: ",any2unistr(v_1), " Expected: UNINITIALIZED");} + + } + + control{ + execute(TC_Sem_160102_predefined_functions_043()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e637a2e3c0478aed88d2bd77404141ba4b34f65 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_044.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function any2unistr, + * the invalue parameter of the any2unistr function may be uninitialized or partially initialized; +*/ + +module Sem_160102_predefined_functions_044 { + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_044 () runs on GeneralComp { + + var bitstring v_2 := '11101'B; //bitstring + + //bitstring + if(match(any2unistr(v_2),"'11101'B")) { setverdict(pass,"Result: ",any2unistr(v_2));} + else{setverdict(fail,"Result is: ",any2unistr(v_2), " Expected:'11101'B");} + + } + + control{ + execute(TC_Sem_160102_predefined_functions_044()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa1d1e7432beffbd78bd2d6c7919580c533a8017 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_045.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function any2unistr, + * the invalue parameter of the any2unistr function may be uninitialized or partially initialized; +*/ + +module Sem_160102_predefined_functions_045 { + + type record of integer MyRoI; + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_045 () runs on GeneralComp { + + template MyRoI v_3 := *; //template record of integer anyvalue + + //template record of integer anyvalue (*) + if(match(any2unistr(v_3),"*")) { setverdict(pass,"Result: ",any2unistr(v_3));} + else{setverdict(fail,"Result is: ",any2unistr(v_3), " Expected:*");} + + } + + control{ + execute(TC_Sem_160102_predefined_functions_045()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a493b0406c90b18ae23eb4fb4a332a44307da8aa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_046.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function any2unistr, + * the invalue parameter of the any2unistr function may be uninitialized or partially initialized; +*/ + +module Sem_160102_predefined_functions_046 { + + type record MyRec { + integer field1, + boolean field2, + integer field3 optional + }; + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_046 () runs on GeneralComp { + template MyRec v_4 := {1,false,-}; // record containing integer, boolean and optional elements + // record containing integer, boolean and optional elements + // NOTE: different tools might use different whitespace formats + if(match(any2unistr(v_4), pattern "\s#(){\s#()field1\s#():=\s#()1\s#(),\s#()field2\s#():=\s#()false\s#(),\s#()field3\s#():=\s#()((UNINITIALIZED)|\-)\s#()}\s#()" )) { + setverdict(pass,"Result: ",any2unistr(v_4)); + } else { + setverdict(fail,"Result is: ",any2unistr(v_4), " Expected:{ field1 := 1, field2 := false, field3 := UNINITIALIZED }"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_046()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea8655f2d3a092c2229ba2f4df594e5cc5b19009 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_047.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_047 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_047 () runs on GeneralComp { + + var template MyRecofInt v_0 := {1,2,3} ifpresent; // ifpresent + + + + if ( match(istemplatekind(v_0, "ifpresent"), true)) {setverdict(pass," ifpresent: ", istemplatekind(v_0, "ifpresent"));} + else{setverdict(fail," ifpresent:",istemplatekind(v_0, "ifpresent"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_047()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d4f10e4ddcae68d46ca7bcbdbea79bf2ff4faba --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_048.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_048 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_048 () runs on GeneralComp { + + var template MyRecofInt v_1 := {1,2,3,4,5}; // specific value of integer type + + if ( match(istemplatekind(v_1, "value"), true)) {setverdict(pass," value: ", istemplatekind(v_1, "value"));} + else{setverdict(fail," value:",istemplatekind(v_1, "value"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_048()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f6005a92f17ace042198065069f514c51c1f63c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_049.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_049 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_049 () runs on GeneralComp { + + var template MyRecofInt v_1 := {1,2,3,4,5}; // specific value of integer type + var template integer v_2 := (all from v_1, 10); //Template list + + if ( match(istemplatekind(v_2, "list"), true)) {setverdict(pass," list: ", istemplatekind(v_2, "list"));} + else{setverdict(fail," value:",istemplatekind(v_2, "list"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_049()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e13f3528a2d0fd605b5459eb15b009470e76b6c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_050.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_050 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_050 () runs on GeneralComp { + var template MyRecofInt v_1 := {1,2,3,4,5}; // specific value of integer type + var template integer v_3 := complement(all from v_1, 10); //component + + if ( match(istemplatekind(v_3, "complement"), true)) {setverdict(pass," component: ", istemplatekind(v_3, "complement"));} + else{setverdict(fail," componenet:",istemplatekind(v_3, "complement"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_050()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7745edb2e7f82b305d3fb1dbd525f8dacf45cc6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_051.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_051 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_051 () runs on GeneralComp { + + var template MyRecofInt v_4 :=?; //anytype (?) + + if ( match(istemplatekind(v_4, "AnyValue"), true)) {setverdict(pass," AnyValue: ", istemplatekind(v_4, "AnyValue"));} + else{setverdict(fail," AnyValue:",istemplatekind(v_4, "AnyValue"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_051()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b081263294a9a00223b7afb9b95ba8d64f1cd69a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_052.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_052 { + + + type component GeneralComp { + } + + /*Type definition:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_052 () runs on GeneralComp { + + var template MyRecofInt v_5 := *; //anyvalue (*) + + if ( match(istemplatekind(v_5, "AnyValueOrNone"), true)) {setverdict(pass," AnyValueOrNone: ", istemplatekind(v_5, "AnyValueOrNone"));} + else{setverdict(fail," AnyValueOrNone:",istemplatekind(v_5, "AnyValueOrNone"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_052()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ceea02694a2a7ee009d9200443fa2af32bf552e8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_053.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_053 { + + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_053 () runs on GeneralComp { + + var template integer v_6 := (-100 .. -1); // tamplate with ranged values + + if ( match(istemplatekind(v_6, "range"), true)) {setverdict(pass," range: ", istemplatekind(v_6, "range"));} + else{setverdict(fail," range:",istemplatekind(v_6, "range"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_053()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23d85e8b756136f655a8c81da65cdd38817f42da --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_054.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_054 { + + + type component GeneralComp { + } + type set of integer MySet(0 .. 10); + + testcase TC_Sem_160102_predefined_functions_054 () runs on GeneralComp { + + var template MySet v_7 := superset (1, 2, 3); //superset + + if ( match(istemplatekind(v_7, "superset"), true)) {setverdict(pass," superset: ", istemplatekind(v_7, "superset"));} + else{setverdict(fail," superset:",istemplatekind(v_7, "superset"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_054()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eeab9a94cd30dd4d7b92541f3da763dc331d1fd4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_055.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_055 { + + + type component GeneralComp { + } + type set of integer MySet(0 .. 10); + + testcase TC_Sem_160102_predefined_functions_055 () runs on GeneralComp { + + var template MySet v_8 := subset (1, 2, 3); //subset + + if ( match(istemplatekind(v_8, "subset"), true)) {setverdict(pass," superset: ", istemplatekind(v_8, "subset"));} + else{setverdict(fail," subset:",istemplatekind(v_8, "subset"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_055()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1b637bbf11a60946129f2baba9be8389878c21c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_056.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_056 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_056 () runs on GeneralComp { + + var template MyRecofInt v_9 := omit length (1 .. 6); // omit and length restriction + + if ( match(istemplatekind(v_9, "omit"), true)) {setverdict(pass," omit: ", istemplatekind(v_9, "omit"));} + else{setverdict(fail," omit:",istemplatekind(v_9, "omit"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_056()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d68290b908da7e3802273ef11811dcfc3d2195af --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_057.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_057 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_057 () runs on GeneralComp { + + var template MyRecofInt v_9 := * length (1 .. 6); // omit and length restriction + + + if ( match(istemplatekind(v_9, "length"), true)) {setverdict(pass," length: ", istemplatekind(v_9, "length"));} + else{setverdict(fail," length:",istemplatekind(v_9, "length"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_057()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96b45d8bcc29ba8ce5f312a2a95d9c5810f62ec1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_058.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_058 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_058 () runs on GeneralComp { + + var template MyRecofInt v_10 := {permutation(1, 2, 3),?,*} ; // permutation, Any element(?) and AnyElementsOrNone(*) + + + if ( match(istemplatekind(v_10, "AnyElement"), true)) {setverdict(pass," AnyElement: ", istemplatekind(v_10, "AnyElement"));} + else{setverdict(fail," AnyElement:",istemplatekind(v_10, "AnyElement"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_058()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9a19ab96cda437d1ddb6a0713e481416c8060e2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_059.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_059 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_059() runs on GeneralComp { + + var template MyRecofInt v_10 := {permutation(1, 2, 3),?,*} ; // permutation, Any element(?) and AnyElementsOrNone(*) + + + if ( match(istemplatekind(v_10, "AnyElementsOrNone"), true)) {setverdict(pass," AnyElementsOrNone: ", istemplatekind(v_10, "AnyElementsOrNone"));} + else{setverdict(fail," AnyElementsOrNone:",istemplatekind(v_10, "AnyElementsOrNone"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_059()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5596c5d0d166964fb2848ada0439d28c09dd20c3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_060.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_060 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_060() runs on GeneralComp { + + var template MyRecofInt v_10 := {permutation(1, 2, 3),?,*} ; // permutation, Any element(?) and AnyElementsOrNone(*) + + + if ( match(istemplatekind(v_10, "permutation"), true)) {setverdict(pass," permutation: ", istemplatekind(v_10, "permutation"));} + else{setverdict(fail," permutation:",istemplatekind(v_10, "permutation"), " expected result: true");} + } + control{ + + execute(TC_Sem_160102_predefined_functions_060()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39ef3f4b9a199c29ba185c7abdecb7795933d850 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_061.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * this test investigates that IUT correctly evaluates predefined function istemplateking().*/ + +module Sem_160102_predefined_functions_061 { + + + type component GeneralComp { + } + /*Type definitions:*/ + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_061() runs on GeneralComp { + + var template charstring v_11 := pattern "abc"; //pattern template + + if ( match(istemplatekind(v_11, "pattern"), true)) {setverdict(pass," pattern: ", istemplatekind(v_11, "pattern"));} + else{setverdict(fail," pattern:",istemplatekind(v_11, "pattern"), " expected result: true");} + + } + control{ + + execute(TC_Sem_160102_predefined_functions_061()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_062.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17396ebe25a618659887d4229e8923354ba6124d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_062.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.3.5) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_160102_predefined_functions_062 { + + type component GeneralComp { + } + + type record of integer MyRecofInt; + + testcase TC_Sem_160102_predefined_functions_062() runs on GeneralComp { + var template MyRecofInt v_1 := {1,2,3,4,5}; // specific value of integer type + var template bitstring enc := decmatch v_1; //encoded template + + if (match(istemplatekind(enc, "decmatch"), true)) { + setverdict(pass, "decmatch: ", istemplatekind(enc, "decmatch")); + } else { + setverdict(fail, "decmatch: ", istemplatekind(enc, "decmatch"), "; expected result: true"); + } + + } + + control { + execute(TC_Sem_160102_predefined_functions_062()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16e657918078ec7d1086f10a5bf21cbc65104830 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_063.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf8)*/ + + + +module Sem_160102_predefined_functions_063 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_063 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_8 := encvalue_unichar(v_test,"UTF-8"); //encode to universal charstring UTF-8 + setverdict(pass,"Encoded value: ", v_test_enc_8); + + } + + + + control{ + + execute(TC_Sem_160102_predefined_functions_063()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a3b92bccbfdb46731bb98eceb76d4eb5893ccc5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_064.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-16)*/ + + + +module Sem_160102_predefined_functions_064 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_064 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_16 := encvalue_unichar(v_test,"UTF-16"); //encode to universal charstring UTF-16 + setverdict(pass,"Encoded value: ", v_test_enc_16); + + } + + + + control{ + + execute(TC_Sem_160102_predefined_functions_064()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18ff74221120f87c3e2972a76c8e0dc9c422d961 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_065.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-16) */ + + + +module Sem_160102_predefined_functions_065 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_065 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_32 := encvalue_unichar(v_test,"UTF-32"); //encode to universal charstring UTF-32 + setverdict(pass,"Encoded value: ", v_test_enc_32); + + } + + + + control{ + + execute(TC_Sem_160102_predefined_functions_065()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..09e5897f8855ccdda8720d54b6e69740e3fdf7de --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_066.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-16 little endian)*/ + + + +module Sem_160102_predefined_functions_066 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_066 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_16LE := encvalue_unichar(v_test,"UTF-16LE"); //encode to universal charstring UTF-16 little endian + setverdict(pass,"Encoded value: ", v_test_enc_16LE); + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_066()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..686d2cce73dbfee56fe048f253ce0d35f24f4777 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_067.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-16 big endian)*/ + + + +module Sem_160102_predefined_functions_067 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_067 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_16BE := encvalue_unichar(v_test,"UTF-16BE"); //encode to universal charstring UTF-16 big endian + setverdict(pass,"Encoded value: ", v_test_enc_16BE); + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_067()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a4f7516efba078b690aa9b42e1fb1fdb2a2e9bf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_068.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-32 little endian)*/ + + + +module Sem_160102_predefined_functions_068 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_068 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_32LE := encvalue_unichar(v_test,"UTF-32LE"); //encode to universal charstring UTF-32 little endian + setverdict(pass,"Encoded value: ", v_test_enc_32LE); + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_068()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d7741d6e3adf1c6565eb12a99e779cbf16a2126 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_069.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions encvalue_unichar (utf-32 big endian)*/ + + + +module Sem_160102_predefined_functions_069 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_069 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_32BE := encvalue_unichar(v_test,"UTF-32BE"); //encode to universal charstring UTF-32 big endian + setverdict(pass,"Encoded value: ", v_test_enc_32BE); + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_069()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c482cb096cad32185206935253aac4deb97b9d37 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_070.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-8)*/ + + + +module Sem_160102_predefined_functions_070 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_070 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar(123,"UTF-8"); + + + //decode: + var integer v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-8"); //decode (UTF-8) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_070()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e37abd97486383fde348b72d1057972236da2c28 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_071.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ +//NOT working with TestCast 6.8.2.5 -test fails + + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-8) with charstring input*/ + + + +module Sem_160102_predefined_functions_071 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_071 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar("aBcDeF","UTF-8"); + + + //decode: + var charstring v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-8"); //decode (UTF-8) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_071()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f09b8576e1b88e73d6699345fad6ce82b9d96c8c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_072.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-16)*/ + + + +module Sem_160102_predefined_functions_072 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_072 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar(123,"UTF-16"); + + + //decode: + var integer v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16"); //decode (UTF-16) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_072()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..557fe7b6e6f426b9cef67d98404a8f9bc06110ad --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_073.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-16) with charstring input*/ + + + +module Sem_160102_predefined_functions_073 { + + type component GeneralComp { + + } + + type universal charstring UStr with { variant "UTF-16LE" } + testcase TC_Sem_160102_predefined_functions_073 () runs on GeneralComp { + + + //encoded text: + var UStr v_test := "aBcDe"; + var universal charstring v_enc := encvalue_unichar(v_test,"UTF-16LE"); + + //decode: + var UStr v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16LE"); //decode (UTF-16LE) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_test_dec , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_test_dec, " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_073()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc7b0e2746dd01d65399e255fd2dd3415ff80f5f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_074.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 (updated by STF 512) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-32)*/ + + + +module Sem_160102_predefined_functions_074 { + + type component GeneralComp { + + } + + type integer Int with { variant "32 bit" }; // produces value that can be transformed to UTF-32 + testcase TC_Sem_160102_predefined_functions_074 () runs on GeneralComp { + var Int v_src := 123; + + //encoded text: + var universal charstring v_enc := encvalue_unichar(v_src, "UTF-32"); //encode UTF-32 + + //decode: + var Int v_test_dec; + var integer v_res:= decvalue_unichar(v_enc, v_test_dec, "UTF-32"); //decode (UTF-32) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_074()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83334d5918e9995ebb4b57e3ac537b5b42eef0d9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_075.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ +//NOT working with TestCast 6.8.2.5 -test fails + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-32) with charstring input*/ + + + +module Sem_160102_predefined_functions_075 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_075 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar("aBc","UTF-32"); //encode UTF-32 + + + //decode: + var charstring v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-32"); //decode (UTF-32) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_075()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7dbf9c6feb0368dfb6f7cf37c948a3f6c4e023e9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_076.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-16 little endian)*/ + + + +module Sem_160102_predefined_functions_076 { + + type component GeneralComp { + + } + + type integer Int with { variant "16 bit" } // standardized variant, 2 octets should be acceptable for UTF-16 + testcase TC_Sem_160102_predefined_functions_076 () runs on GeneralComp { + var Int v_test := 100; + + //encoded text: + var universal charstring v_enc := encvalue_unichar(v_test, "UTF-16LE"); + + //decode: + var Int v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16LE"); //decode (UTF-16 little endian) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_076()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50d1b67140228c9aaf222b939f5422db1790fffa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_077.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-16 big endian)*/ + + + +module Sem_160102_predefined_functions_077 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_077 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar(123,"UTF-16BE"); + + + //decode: + var integer v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16BE"); //decode (UTF-16 big endian) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_077()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e91ad3e38ef243d6f1bbe775522094fe0b6dd308 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_078.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-16 big endian)*/ + + + +module Sem_160102_predefined_functions_078 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_078 () runs on GeneralComp { + + + //encoded text: + var universal charstring v_enc := encvalue_unichar(123,"UTF-16BE"); + + + //decode: + var integer v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16BE"); //decode (UTF-16 big endian) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_078()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8d8401fd702e0fb77a7102529296d83558f8c5b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_079.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + + * this test focuses on the predefined functions decvalue_unichar (utf-32 big endian)*/ + + + +module Sem_160102_predefined_functions_079 { + + type component GeneralComp { + + } + + type integer Int with { variant "32 bit" }; // standardized variant encodes into 4 octets + testcase TC_Sem_160102_predefined_functions_079 () runs on GeneralComp { + var Int v_test := 123; + + //encoded text: + var universal charstring v_enc := encvalue_unichar(v_test, "UTF-32BE"); + + //decode: + var Int v_test_dec; + var integer v_res:= decvalue_unichar(v_enc,v_test_dec, "UTF-32BE"); //decode (UTF-32 big endian) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_enc , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_079()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8213067b6fab71308591f57bf7ac8778a0eee830 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_080.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined decvalue and decvalue_unichar function works properly in case of uninitialized encode value is given + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * all actual in and inout parameters shall be initialized with the following exceptions: + * 16.1.2. Restriction a.3 : the encoded_value parameter of the decvalue and decvalue_unichar function may be uninitialized.*/ + +module Sem_160102_predefined_functions_080 { + type enumerated E { one(1), two(2), three(3) } with { variant "32 bit"}; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_080 () runs on GeneralComp { + + var bitstring v_test; // uninitialized value for encoded_value parameter decvalue() input + var universal charstring v_test_enc_8; // uninitialized value encoded_value parameter for decvalue_unichar() input + var E v_decoded; + var E v_decoded_8; + + var integer v_res := decvalue(v_test, v_decoded); + var integer v_res_8 := decvalue_unichar(v_test_enc_8, v_decoded_8, "UTF-8"); + + if(match(v_res,1)){ + setverdict(pass,"Decoded ", v_decoded , " with result ", v_res); + }else{ + setverdict(fail,"Decode failed ", v_decoded , " with result ", v_res); + } + + if(match(v_res_8,1)){ + setverdict(pass,"Decoded ", v_decoded_8 , " with result ", v_res_8); + }else{ + setverdict(fail,"Decode failed ", v_decoded_8 , " with result ", v_res_8); + } + } + control{ + execute(TC_Sem_160102_predefined_functions_080()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eed5f441e572e86ae622c0db480c1fccf0cdeaec --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_081.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function get_stringencoding works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * The get_stringencoding function analyses the encoded_value and returns the UCS encoding scheme.*/ + + +module Sem_160102_predefined_functions_081 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_081 () runs on GeneralComp { + + + var octetstring v_test := '414243C3A9C3BC'O; //UTF-8 encoded octetstring. The decoded value is: ABCéü + + var charstring v_get := get_stringencoding(v_test); // expected result: "UTF8" + + if (match(v_get , ("UTF-8",""))) { + setverdict(pass,"Decoded: ",v_get); + } else { + setverdict(fail, "Unexpected result: ", v_get); + } + } + + + + control{ + execute(TC_Sem_160102_predefined_functions_081()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c4fc4e41837a244c1e87a97c5e78775e9824d53 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_082.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function for removing Byte order mark works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that reomve_bom() function successfully removes the byte order mark present at the beginning of a stream of serialized (encoded) universal character strings + UCS encoding scheme + */ + + +module Sem_160102_predefined_functions_082 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_082 () runs on GeneralComp { + + + var octetstring v_test_1 :='FEFF0AC2'O ; + var octetstring v_test_2 :='C0'O ; + + var octetstring v_remove := remove_bom(v_test_1); // expected result: v_remove := '0AC2'O + var octetstring v_remove_2 := remove_bom(v_test_2); // expected result: v_remove := 'C0'O + + if (match(v_remove,'0AC2'O) and match(v_remove_2, 'C0'O)) { + setverdict(pass,"Results are: ",v_remove, " and ",v_remove_2 ); + } else { + setverdict(fail,"Failed,the results are: ",v_remove, " and ",v_remove_2, "Expected: '0AC2'O and 'C0'O"); + } + } + + + + control{ + execute(TC_Sem_160102_predefined_functions_082()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_083.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dd35791c717bf4b598c5173badc5d2940de8ad1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_083.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_083 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_083 () runs on GeneralComp { + + var boolean v_res; + + template charstring Mytemaplate:= "1234ABCD"; + + + + v_res := isvalue(Mytemaplate); //template, expected result: true + + + + if ( match(v_res, true)) {setverdict(pass," isvalue(Mytemaplate): ", v_res);} + else{setverdict(fail," isvalue(Mytemaplate):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_083()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_084.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f86217385c5666d05a34724c82da9e394cc5f7b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_084.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_084 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_084 () runs on GeneralComp { + + var boolean v_res; + + var GeneralComp MyComp; + + + + v_res := isvalue(MyComp); //component ,expected result: false + + + + if ( match(v_res, false)) {setverdict(pass," isvalue(MyComp): ", v_res);} + else{setverdict(fail," isvalue(MyComp):", v_res, " expected result: false");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_084()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_085.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82efc2177679fcd66d8437534adddb67da9be59c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_085.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_085 { + + type integer address; + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_085 () runs on GeneralComp { + + var boolean v_res; + + var address MyAddr := null; + + + + v_res := isvalue(MyAddr); //address, expected result: true + + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyAddr): ", v_res);} + else{setverdict(fail," isvalue(MyAddr):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_085()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_086.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4c88cc20c8f9a5b367f72bf0d7b255d86e709867 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_086.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_086 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_086 () runs on GeneralComp { + + var boolean v_res; + + var default MyDef := null; + + + + v_res := isvalue(MyDef); //dafult, expected result: true + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyDef): ", v_res);} + else{setverdict(fail," isvalue(MyDef)):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_086()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_087.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..582c18eae35232890c278873fea7569ac440fdef --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_087.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_087 { + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_087 () runs on GeneralComp { + + var boolean v_res; + + template charstring Mytemaplate2 := pattern "A*Z"; + + + + v_res := isvalue(Mytemaplate2); //pattern, expected result: false + + + if ( match(v_res, false)) {setverdict(pass," isvalue(Mytemaplate2: ", v_res);} + else{setverdict(fail," isvalue(Mytemaplate2): ", v_res, " expected result: false");} + + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_087()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_088.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..50f2b80cf191bad745f8ddb322ff3ae5344417a8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_088.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_088 { + + type record MyRec{ + integer field1, + integer field2 optional} + + type record MyRec2 { + MyRec field1, + integer field2 + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_088() runs on GeneralComp { + + var boolean v_res; + + var MyRec2 MyRecValue := {{1,-},1}; + + + + v_res := isvalue(MyRecValue.field1.field1); //nested, expected result: true + + + if ( match(v_res, true)) {setverdict(pass," isvalue(MyRecValue.field1.field1): ", v_res);} + else{setverdict(fail," isvalue(MyRecValue.field1.field1):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_088()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_089.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ace8bc9e3152ae61d5c86d08f4e134990b3a4c12 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_089.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined function isvalue() works properly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that isvalue() predefined function works properly + */ + + +module Sem_160102_predefined_functions_089 { + + type record MyRec{ + integer field1, + integer field2 optional} + + type record MyRec2 { + MyRec field1, + integer field2 + } + + type component GeneralComp { + } + + testcase TC_Sem_160102_predefined_functions_089() runs on GeneralComp { + + var boolean v_res; + + var MyRec2 MyRecValue := {{1,-},1}; + + + + v_res := isvalue(MyRecValue.field1.field2); //nested omit, expected result: false + + + if ( match(v_res, false)) {setverdict(pass," isvalue(MyRecValue.field1.field2): ", v_res);} + else{setverdict(fail," isvalue(MyRecValue.field1.field2):", v_res, " expected result: true");} + + } + + + control{ + execute(TC_Sem_160102_predefined_functions_089()); + } +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..742f4f9f9295bc77b52251b86cc3ccdb5f87a9a3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_090.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C.4.1) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * Check that regexp predefined function with @nocase modfier evaluates the charstrings case insensitive way + * + * */ + +module Sem_160102_predefined_functions_090 { + + type component GeneralComp { + } + + + testcase TC_Sem_160102_predefined_functions_090 () runs on GeneralComp { + var charstring v_example_1:="example text string"; + var charstring v_example_2:="ExAmPlE TeXt StRinG"; + + var charstring v_i,v_j; + + v_i := regexp @nocase(v_example_1,charstring:"?+(TeXt)?+",0); //capital letters in expression + v_j := regexp @nocase(v_example_2,charstring:"?+(text)?+",0); //captial letters in inpar + + if(match(v_i,"text") and match(v_j,"TeXt")) { + setverdict(pass,"Results are: ",v_i, " and ", v_j); + } else { + setverdict(fail,"Results are: ",v_i, " and ", v_j); + } + } + + + control{ + + execute(TC_Sem_160102_predefined_functions_090()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62fd9e341fa28e2ebb87af352b7beebb83eec753 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_091.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that rnd() uses seeds per component + * + */ + + +module Sem_160102_predefined_functions_091 { + + type component GeneralComp {} + + + //function to generate random number with seed given as input + function frnd(float seed) runs on GeneralComp { + var float v_random1 := rnd(seed); + var float v_random2 := rnd(); + + setverdict(pass); + if (not match(rnd(seed), v_random1)) { + setverdict(fail, "rnd from same seed has to be identical to ", v_random1); + } + if (match(rnd(seed+1.0), v_random1)) { + setverdict(fail, "rnd from different seed should not be identical with ", v_random1); + } + } + + testcase TC_Sem_160102_predefined_functions_091 (float General_Comp_seed) runs on GeneralComp system GeneralComp { + + var float v_random1,v_random2; + + //Generate components with different seeds + var GeneralComp v_ptc1,v_ptc2; + + v_ptc1:= GeneralComp.create alive; + v_ptc2:= GeneralComp.create alive; + + //different seeds given to components: + v_ptc1.start(frnd(General_Comp_seed)); + v_ptc2.start(frnd(General_Comp_seed+0.5)); + all component.done; + } + + control{ + const float General_Comp_seed := 0.0; + execute(TC_Sem_160102_predefined_functions_091(General_Comp_seed)); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79d09ce52e4722900a27a163aba14f18540ee096 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_092.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + *16.1.2 Restriction a.3: + * any_string or sequence_type parameters of the functions substr may be partially initialized; */ + + +module Sem_160102_predefined_functions_092 { + + type component GeneralComp {} + + type record of integer RoI; + + + testcase TC_Sem_160102_predefined_functions_092 () runs on GeneralComp { + + var RoI v_Rec1; + var RoI v_res; + + v_Rec1 :={-,0,-,2}; //partially initialized record of integers + v_res := substr(v_Rec1,1,1); //expected result: {0} + + if( match(v_res,{0}) ) { + setverdict(pass,v_res); + } else { + setverdict(fail,"The value of v_res:",v_res); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_092()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_093.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_093.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d0059872eb0eeb49f465c0f4c08df9893278daa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_093.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Ensure that integer value of an enum handled correctly + +module Sem_160102_predefined_functions_093 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday(3..5) + }; + + testcase TC_Sem_160102_predefined_functions_093() runs on GeneralComp { + var EDays v_enum := Thursday; + + int2enum(4,v_enum); // new value for v_enum is Friday(4) + + if (match(enum2int(v_enum),4) and match(v_enum,Friday(4))) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_093()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_094.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_094.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5757e9a1b095be08e535c2099be6863e0de0e42e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_094.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Ensure that integer value of an enum handled correctly + +module Sem_160102_predefined_functions_094 { + + type component GeneralComp { + } + + type enumerated EDays { + Monday, Tuesday, Wednesday, Thursday, Friday(3..5) + }; + + testcase TC_Sem_160102_predefined_functions_094 () runs on GeneralComp { + var EDays v_enum := Friday(3); + var integer v_day := enum2int(v_enum); + + if (match(v_day,3)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_160102_predefined_functions_094 ()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_095.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_095.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd3af395280ecba43a4540b350263bf399398199 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_095.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: Using ischosen for anytype + +module Sem_160102_predefined_functions_095 { + type union U { integer f1, octetstring f2 } + +type component GeneralComp { +} + + +testcase TC_Sem_160102_predefined_functions_095 () runs on GeneralComp { + template U m_u4 := ({ f1 := 2 }, {f2 := 'AB'O }); + template anytype mw_anytype := { U := m_u4 } + var boolean v_i; + + v_i:=ischosen(mw_anytype.U); //function returns true value + if(match(v_i,true)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected decoding result"); + } +} + + +control{ + + execute(TC_Sem_160102_predefined_functions_095()); + +} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_096.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_096.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aceaf70cf15c5c6e79b09c98bf7bb1f0a74fc037 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_096.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: Using ischosen for anytype + +module Sem_160102_predefined_functions_096 { + +type component GeneralComp { +} + +type union U { integer f1, charstring f2 }; + + +testcase TC_Sem_160102_predefined_functions_096 () runs on GeneralComp { + + template anytype mw_anytype := { U.f1:=1}; + var boolean v_i, v_j; + + v_i:=ischosen(mw_anytype.integer); //function returns false + + if(match(v_i,false)) { + setverdict(pass); + } else { + setverdict(fail, "Unexpected result for ischosen()"); + } +} + + +control{ + + execute(TC_Sem_160102_predefined_functions_096()); + +} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_097.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_097.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dccaebbed884bea86754e1f2ecf6e1b07f56ce1d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_097.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: +// The optional encoding_info parameter is used for passing additional encoding information to the codec and, if it is omitted, no additional information is sent to the codec. + +module Sem_160102_predefined_functions_097 { + +type component GeneralComp { +} + + type integer I with { variant "32 bit"}; + + + testcase TC_Sem_160102_predefined_functions_097 () runs on GeneralComp { + var template I v_test := 0; + var bitstring v_res := encvalue(v_test, "encoding_info_text"); + if (lengthof(v_res) == 32) { + setverdict(pass,v_res); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_097()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_098.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_098.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3df2b7a6a4dd8901e34a7308f2209a2d3ffe924e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_098.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// The following requirements are tested: +// The optional decoding_info parameter is used for passing additional encoding information to the codec and, if it is omitted, no additional information is sent to the codec. + +module Sem_160102_predefined_functions_098 { + +type component GeneralComp { +} + + type integer I with { variant "32 bit"}; + + + testcase TC_Sem_160102_predefined_functions_098 () runs on GeneralComp { + var template I v_test := 0; + var bitstring v_enc := encvalue(v_test, "encoding_info_text"); + + if (match(decvalue(v_enc,v_test,"decoding_info_text"), 0)){ + setverdict(pass,v_enc); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_098()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_099.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_099.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be8b71304a0b7636a9e9db9e69ef7ec664dad2f5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_099.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + * The optional encoding_info parameter is used for passing additional encoding information to the codec and, + * if it is omitted, no additional information is sent to the codec.*/ + + +module Sem_160102_predefined_functions_099 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_099 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + + var universal charstring v_test_enc_8 := encvalue_unichar(v_test,"UTF-8", "encoding_info_text"); //encode to universal charstring UTF-8 + setverdict(pass,"Encoded value: ", v_test_enc_8); + + } + + + + control{ + + execute(TC_Sem_160102_predefined_functions_099()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1081cee3a89bd7c205d12b214f43e28ea17a0fb --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_100.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Ensure that predefined encvalue_unichar function works properly in case of encoding universal charstring + ** @verdict pass accept, ttcn3verdict:pass + + ***************************************************/ + +/* The following requirements are tested: + * The optional decoding_info parameter is used for passing additional encoding information to the codec and, + * if it is omitted, no additional information is sent to the codec.*/ + + +module Sem_160102_predefined_functions_100 { + + type component GeneralComp { + + } + + testcase TC_Sem_160102_predefined_functions_100 () runs on GeneralComp { + + var charstring v_test := "abc"; + + //Encoding: + var universal charstring v_test_enc_8 := encvalue_unichar(v_test,"UTF-8", "encoding_info_text"); //encode to universal charstring UTF-8 + + //Decoding: + var integer v_test_dec; + var integer v_res:= decvalue_unichar(v_test_enc_8,v_test_dec,"UTF-8", "encoding_info_text"); //decode (UTF-8) + + if (v_res == 0) { + setverdict(pass, "Decoded ", v_test_enc_8 , " with result ", v_res); + } else { + setverdict(fail, "Unexpected decoding result: Decoded ", v_test_enc_8 , " with result ", v_res); + } + + } + + control{ + + execute(TC_Sem_160102_predefined_functions_100()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b802ba9c891fcd0395d3f8beaf5da25b041f597d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_101.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the encvalue function supports the dynamic_encoding parameter + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the inpar value for this single encvalue call. The rules for dynamic +// selection of the encode attribute are described in clause 27.9. + +// NOTE: the test is not executed as it would require dedicated codec support + +module Sem_160102_predefined_functions_101 { + + type component GeneralComp { + } + + type integer I with { + encode "Codec 1"; + encode "Codec 2" + }; + + testcase TC_Sem_160102_predefined_functions_101 () runs on GeneralComp { + var template I v_test := 0; + var bitstring v_res := encvalue(v_test, -, "Codec 1"); + setverdict(pass); + } + + //control{ + // execute(TC_Sem_160102_predefined_functions_101()); + //} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37be6d69d9258c61ceb766b4b3f6ee00288f026c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_102.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the encvalue function can be explicitly skipped + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the inpar value for this single encvalue call. The rules for dynamic +// selection of the encode attribute are described in clause 27.9. + +module Sem_160102_predefined_functions_102 { + + type component GeneralComp { + } + + type integer I with { variant "32 bit"}; + + testcase TC_Sem_160102_predefined_functions_102 () runs on GeneralComp { + var template I v_test := 0; + var bitstring v_res := encvalue(v_test, "encoding_info_text", -); + if (lengthof(v_res) == 32) { + setverdict(pass,v_res); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_102()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44b6c3a997d22fed95255ad1a77411bf709a3181 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_103.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the decvalue function supports the dynamic_encoding parameter + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the decoded_value parameter for this single decvalue call. The rules +// for dynamic selection of the encode attribute are described in clause 27.9. + +// NOTE: the test is not executed as it would require dedicated codec support + +module Sem_160102_predefined_functions_103 { + + type component GeneralComp { + } + + type integer I with { + encode "Codec 1"; + encode "Codec 2" + }; + + testcase TC_Sem_160102_predefined_functions_103 () runs on GeneralComp { + var template I v_target := 0; + var bitstring v_src := oct2bit('00000000'O); + decvalue(v_src, v_target, -, "Codec 1"); + setverdict(pass); + } + + //control{ + // execute(TC_Sem_160102_predefined_functions_103()); + //} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a9f4e400ef43b943b81f1457323ac3b33b330e2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_104.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the decvalue function can be explicitly skipped + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the decoded_value parameter for this single decvalue call. The rules +// for dynamic selection of the encode attribute are described in clause 27.9. + +module Sem_160102_predefined_functions_104 { + + type component GeneralComp { + } + + type integer I with { variant "32 bit"}; + + testcase TC_Sem_160102_predefined_functions_104 () runs on GeneralComp { + var template I v_target := 0; + var bitstring v_src := oct2bit('00000000'O); + var integer v_res := decvalue(v_src, v_target, "encoding_info_text", -); + if (v_res == 0) { + setverdict(pass, "Decoded value is: ", v_target); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_104()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..828e5ceb312d4cffcda14ec103a3f3c698d80e39 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_105.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the encvalue_unichar function supports the dynamic_encoding parameter + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the inpar value for this single encvalue_unichar call. The rules for +// dynamic selection of the encode attribute are described in clause 27.9. + +// NOTE: the test is not executed as it would require dedicated codec support + +module Sem_160102_predefined_functions_105 { + + type component GeneralComp { + } + + type integer I with { + encode "Codec 1"; + encode "Codec 2" + }; + + testcase TC_Sem_160102_predefined_functions_105 () runs on GeneralComp { + var template I v_test := 0; + var universal charstring v_res := encvalue_unichar(v_test, -, "Codec 1"); + setverdict(pass); + } + + //control{ + // execute(TC_Sem_160102_predefined_functions_105()); + //} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb8876582d818907cf4c2d4fe588a9e7819e506c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_106.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the encvalue_unichar function can be explicitly skipped + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the inpar value for this single encvalue_unichar call. The rules for +// dynamic selection of the encode attribute are described in clause 27.9. + +module Sem_160102_predefined_functions_106 { + + type component GeneralComp { + } + + type integer I with { variant "32 bit"}; + + testcase TC_Sem_160102_predefined_functions_106 () runs on GeneralComp { + var template I v_test := 100; + var universal charstring v_res := encvalue_unichar(v_test, "UTF-32LE", "encoding_info_text", -); + if (v_res == "d") { + setverdict(pass); + } else { + setverdict(fail, "Invalid encoding result"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_106()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78eee49330a1d7d7adff8a251107cde9e0dd0e8f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_107.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the decvalue_unichar function supports the dynamic_encoding parameter + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the decoded_value parameter for this single decvalue_unichar call. +// The rules for dynamic selection of the encode attribute are described in clause 27.9. + +// NOTE: the test is not executed as it would require dedicated codec support + +module Sem_160102_predefined_functions_107 { + + type component GeneralComp { + } + + type integer I with { + encode "Codec 1"; + encode "Codec 2" + }; + + testcase TC_Sem_160102_predefined_functions_107 () runs on GeneralComp { + var template I v_target := 0; + var universal charstring v_src := "d"; + decvalue_unichar(v_src, v_target, "UTF-32LE", -, "Codec 1"); + setverdict(pass); + } + + //control{ + // execute(TC_Sem_160102_predefined_functions_107()); + //} + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..375c8c4de295ceb34b10422c0fa80010ef1d9174 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160102_predefined_functions/Sem_160102_predefined_functions_108.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.2, Verify that the dynamic_encoding parameter of the decvalue_unichar function can be explicitly skipped + ** @verdict pass accept, noexecution + ***************************************************/ +// The following requirements are tested: +// The optional dynamic_encoding parameter is used for dynamic selection of encode +// attribute of the decoded_value parameter for this single decvalue_unichar call. +// The rules for dynamic selection of the encode attribute are described in clause 27.9. + +module Sem_160102_predefined_functions_108 { + + type component GeneralComp { + } + + type integer I with { variant "32 bit"}; + + testcase TC_Sem_160102_predefined_functions_108 () runs on GeneralComp { + var template I v_target := 0; + var universal charstring v_src := "d"; + var integer v_res := decvalue_unichar(v_src, v_target, "UTF-32LE", "encoding_info_text", -); + if (v_res == 0) { + setverdict(pass, "Decoded value is: ", v_target); + } else { + setverdict(fail, "Invalid encoding length"); + } + } + + control{ + execute(TC_Sem_160102_predefined_functions_108()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/NegSem_160103_external_functions_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/NegSem_160103_external_functions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3bcc56c0edb40b8f30dfeb63fce6c795e11a56e5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/NegSem_160103_external_functions_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.3, Ensure that the IUT recognizes external functions + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ +module NegSem_160103_external_functions_001 { + + type component GeneralComp { + } + + external function xf_NegSem_160103_external_functions_001() return template octetstring; //external functions cannot return template + + testcase TC_NegSem_160103_external_functions_001 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_NegSem_160103_external_functions_001()); + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a28ee6e145377c62e4a84de5f72f65ee81c6d3d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.3, Ensure that the IUT recognizes external functions + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration external_functions + ***************************************************/ +module Sem_160103_external_functions_001 { + + type component GeneralComp { + } + + /** + * @return always 1 + */ + external function xf_Sem_160103_external_functions_001() return integer; + + testcase TC_Sem_160103_external_functions_001 () runs on GeneralComp { + var integer v_i; + + v_i := xf_Sem_160103_external_functions_001(); + + if (v_i == 1) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + + execute(TC_Sem_160103_external_functions_001()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8a73f67ba51ca238ecb9d51c189216e5619d74c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160103_external_functions/Sem_160103_external_functions_002.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.3, Ensure that the IUT recognizes external functions + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration external_functions + ***************************************************/ +module Sem_160103_external_functions_002 { + + type record MyRecord { + integer field1, + integer field2, + integer field3 + } + + type port TestPort message { + inout MyRecord + } + + type component GeneralComp { + } + /** + * @return p_in + 1 + */ + external function xf_Sem_160103_external_functions_002(inout integer p_in) return integer; + + testcase TC_Sem_160103_external_functions_002 () runs on GeneralComp { + var integer v_input := 5; + var integer v_result; + + v_result := xf_Sem_160103_external_functions_002(v_input); + if(v_result==6) { setverdict(pass) } + else { setverdict(fail) } + } + + control{ + + execute(TC_Sem_160103_external_functions_002()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c0a1388e80cfb480c4c0cc83bbab63edcd4f8b0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.4, Ensure that the IUT recognizes restrictions described in section 16.1.4. STF409 assumes that the list given in section 16.1.4 describes mandatory restrictions + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ +module NegSem_160104_invoking_functions_from_specific_places_001 { + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_001 () runs on GeneralComp { + var integer v_i; + + messagePort.send(1); + alt { + //calling an external function in boolean guard + [xf_NegSem_160104_invoking_functions_from_specific_places_001()] messagePort.receive { + v_i:=0; + setverdict(fail); + } + [] messagePort.receive { v_i:=1; } + } + + } + + control{ + + execute(TC_NegSem_160104_invoking_functions_from_specific_places_001()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74751ab265f70c6b0d20091606299c60d2db7049 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_002.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.4, Ensure that the IUT recognizes restrictions described in section 16.1.4. STF409 assumes that the list given in section 16.1.4 describes mandatory restrictions + ** @verdict pass reject + ***************************************************/ +module NegSem_160104_invoking_functions_from_specific_places_002 { + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test() return boolean { + if (rnd() > 0.5) { //calling rnd within a function inside a boolean guard + return true; + } else { + return false; + } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_002 () runs on GeneralComp { + var integer v_i; + + messagePort.send(1); + alt { + [f_test()] messagePort.receive { v_i:=0; } + [] messagePort.receive { v_i:=1; } + } + + } + + control{ + + execute(TC_NegSem_160104_invoking_functions_from_specific_places_002()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1111cb508fa8305f69a295cd618a358fb4fe703 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.4, Ensure that the IUT recognizes restrictions described in section 16.1.4. STF409 assumes that the list given in section 16.1.4 describes mandatory restrictions + ** @verdict pass reject + ***************************************************/ +module NegSem_160104_invoking_functions_from_specific_places_003 { + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test() return boolean { + setverdict(inconc); //setting verdict within a function inside a boolean guard + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_003 () runs on GeneralComp { + var integer v_i; + + messagePort.send(1); + alt { + [f_test()] messagePort.receive { v_i:=0; } + [] messagePort.receive { v_i:=1; } + } + } + + control{ + + execute(TC_NegSem_160104_invoking_functions_from_specific_places_003()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..758e8bf5480173b42510d820cd45418bca9df031 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1.4, Ensure that the IUT recognizes restrictions described in section 16.1.4. STF409 assumes that the list given in section 16.1.4 describes mandatory restrictions + ** @verdict pass reject + ***************************************************/ +module NegSem_160104_invoking_functions_from_specific_places_004 { + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test(inout integer p_int) return boolean { //issue of inout parameter + p_int:=1; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_004 () runs on GeneralComp { + var integer v_i:=0; + + messagePort.send(1); + alt { + [f_test(v_i)] messagePort.receive { + v_i:=0; + setverdict(fail, "function call not allowed in guard"); + } + [] messagePort.receive { + v_i:=1; + setverdict(pass); + } + } + } + + control{ + + execute(TC_NegSem_160104_invoking_functions_from_specific_places_004()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee3d361862aed2135622ca9133084b269a85dc59 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_005.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_005 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_005() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_005()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a877ba4df57d5d9601af30811cebe214bd9472c3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_006.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_006 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_006()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_007.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fe14030e60a703647886c7ce7a8594a37ce18c3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_007.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_007 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_007()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_008.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb1cd7d790e88f2e37d6af40e47a9ebd41b16fb5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_008.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_008 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_008()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_009.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4271dea4b3f5c58a40f5350e836e7f1531e74986 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_009.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_009 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_009()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_010.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d9ada572b111249cbbc159d1ddd0180991a1485 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_010.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_010 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_010()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_011.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..355c886b462a20152706fc7c00b2ed16f859cadf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_011.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_011 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_011()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_012.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fdfe1961a8b32c3f64d4216d43366cca88585a5d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_012.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_012 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy integer mw_test := f_test(v_ptc); + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_012()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_013.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db4f0bbc35eb76207641a6c40ff04116b7eb39e6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_013.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_014.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..867fa411f978bf60bf2c980879337cc5237f3f22 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_014.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_015.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b8360bb97e9aba8aaf8c21641d6823a458170fe --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_015.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_015 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_015() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_015()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_016.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7db6d250c325b28186fe3f6352eeb754d89649fc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_016.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_016 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_016() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_016()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_017.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c54c7ded317f95a722a76214714e9e693542db2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_017.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_017 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_017() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_017()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_018.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7e3d4ab88678c9ffe540108b4ba802121b35008 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_018.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_018 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(2); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_018() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_018()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_019.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c096a4db7ed8dab7ded2913f8e3de070fe262e61 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_019.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_019 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(integer:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_019() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_019()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_020.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e99b99a96a849daa5b0b3ccb9af81757ef677fb8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_020.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(integer:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_020() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_020()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_021.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..989a5b38dc0a7b53548882582b8eda05fdecfdc4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_021.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_021 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_021() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_021()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_022.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73bd4a8bca538c23bd9c4954c0f07fa2f1ace06f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_022.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_022 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_022() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_022()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_023.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3108a76fa602d330df9a4c839539191d8efad027 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_023.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_023 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_023() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_023()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_024.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5df269b85f3c3ccc33b98f58c7daf8cc85d57d2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_024.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_024 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_024() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_024()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_025.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ecb398df2bef04f3d1ded3a5146a7a8bdf590277 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_025.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_025 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_025() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_025()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_026.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9239cd4b3bab45e9d76372d3838157c17dc161a6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_026.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_026 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_026() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_026()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_027.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6ad26f33ec351193c1a23f03b3c275e76fbc806 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_027.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_027 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_027() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_027()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_028.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d97abcc81ca41ae3159b6d5d8fe96856105bdd96 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_028.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_028 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_028() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_028()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_029.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ec4b8bcb922a092199d9395956dbb0b0f452200 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_029.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_029 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_029() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_029()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_030.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49a7497bdfe6b2e7bf55372b8cb3329f32f60315 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_030.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_030 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_030() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_030()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_031.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68666120dca028bfa79a59ef78e3e001c39e4f89 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_031.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_031 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_031() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_031()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_032.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b7f2aa28b77d0e36f07ba9540ee0937d072dac0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_032.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_032 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_032() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_032()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_033.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d67c5607bd538ec52707a9aaa0ffb75b0662bee9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_033.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_033 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_033() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_033()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_034.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..deced8a2df28b5502239534cf2e14a4295368034 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_034.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_034 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_034() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_034()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_035.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2638947acd8b8e470f05c1fd3f2f71a02791aba --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_035.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_035 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_035() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_035()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_036.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cfda03492069bc280dfe905dfc3ef6f8343c0d8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_036.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_036 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_036() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_036()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_037.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9dfca68eaf29919bfab677639fa89190c2bcbbf6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_037.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_037 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_037() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_037()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_038.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec4328ee388d83b85c0a3aa1cda54ebdadf5a45e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_038.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_038 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_038() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_038()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_039.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ee41f223c36f9ee5c0d05f3f37784722c1f52b0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_039.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_039 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_039() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_039()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_040.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe47883450cb5ee8ce72211bfe14ac1adae6bb5e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_040.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an assignment of a component variable (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_040 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_040() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_040()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_041.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bf4b5490d2532e080a7ab33f7b311e21e42b6a8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_041.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual out parameter (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_041 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_041() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_041()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_042.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3d8709ddb5c8a2b7d3d3bc2f2c7c761742962ac --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_042.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual inout parameter (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_042 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_042() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_042()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_043.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ecb256132e508047eeee4120bfcdc10899f30a1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_043.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_043 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_043() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_043()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_044.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddc07aa871ada02d2adc325f9c934c1845e93ea0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_044.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_044 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_044() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_044()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_045.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6265b1cc7595b8a37fc64e48883fcd5c4bd159e0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_045.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in a function called during receiving operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_045 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_045() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_045()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_046.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb4946a2d55f999666a1c323e812f3333f0548f7 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_046.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_046 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_046() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_046()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_047.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dce824afa1fe206f9a62f4aa8f67ac2e906149ac --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_047.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_047 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_047() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_047()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_048.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..514e2c74a9b87ee534477bdea442b9be57c4ebca --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_048.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_048 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_048() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_048()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_049.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6be36d528fa756a3c5704407e88f2f534e3be20d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_049.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_049 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_049() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_049()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_050.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ff568d27fe1b8ce1a4e3342f3a94498e40486bd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_050.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_050 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_050() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_050()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_051.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c842a953b50db8c5ad9fcde42459e34efaee9e1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_051.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_051 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_051() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_051()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_052.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e6e3057aa9a9e3d1068c5208674bf56a4bfa45b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_052.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_052 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_052() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_052()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_053.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acda4c1d99a599f2a5f9d07b2ecbe1365b95f8e5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_053.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_053 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_053() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + template @fuzzy R mw_test := { field1 := f_test(v_ptc) }; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_053()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_054.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5251392344ca8be0b58ab6955cddaba040e527be --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_054.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_054 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_054() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_054()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_055.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e310240e1d0df5800132eb0b40757b54387243e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_055.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_056.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aaa5456cd627b62feec778292d3547061191d673 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_056.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_056 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_056() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_056()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_057.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b179631a6a6e355b12266531648271ebfb7a9dc6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_057.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_057 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_057() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(mw_test) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_057()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_058.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b469e4212249bb86a388055c57145b5d6a2b8729 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_058.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_058 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_058() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_058()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_059.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87c4b6e03f9209b8425b3172dc9492fb3b6957d0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_059.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_059 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(R:{ field1 := 2 }); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_059() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_059()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_060.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a813f379b5b3b09b36556aa9fcddc7744bce779 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_060.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_060 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(R:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_060() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_060()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_061.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..745fc897f514c8f06225f411db688e68e88ebdef --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_061.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_061 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(R:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_061() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_061()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_062.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e88bf05b0f5e389573a8c6b5c9950d26efc70798 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_062.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_062 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_062() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_062()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_063.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cad4369ba7f5835ba39bff7a289ec13ec6a6add2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_063.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_063 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_063() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_063()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_064.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c714e446ac15bea148ea5a191fa3200603c184f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_064.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_064 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_064() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_064()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_065.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05c6bca933b1a24713541559068db44a180781a0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_065.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_065 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_065() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_065()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_066.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf73c6ffb218491c740bb62c4e9d2f1c0125d0e5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_066.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_066 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_066() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_066()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_067.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f318b40f7c8f24add947f2df1aac45751252705 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_067.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_067 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_067() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_067()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_068.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb132d788dcff15059e160758826fdd73471bca7 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_068.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_068 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_068() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_068()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_069.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2fe65cac6fbc0a4b18f3233bb09100533d207fd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_069.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_069 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_069() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_069()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_070.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2119ef5db2df3817c7e83de49343e67e758d1a0e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_070.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_070 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_070() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_070()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_071.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f86fb8e1c4dabe5eaa4ee3430ec524ba8ccec0e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_071.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_071 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_071() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_071()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_072.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94f96b51d8f03b737c53241707132961ec0fafe3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_072.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_072 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_072() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_072()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_073.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99b2e2c121b6b01a0325b29df96e78cc09f8d646 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_073.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_073 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_073() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_073()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_074.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31a6970b5e51e8a494c17a36fa3f95b51d91430f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_074.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_074 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_074() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_074()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_075.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4d685625c88382fe65c2925f135ff9f15183259 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_075.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_075 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_075() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_075()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_076.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d780f828506be94b625bd0984057b47d7bcf9b2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_076.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_076 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_076() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_076()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_077.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f37b15e8fe21c32b46f4ca7baa9d0b642cb020d0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_077.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_077 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_077() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_077()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_078.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27478808577f0f742acc3691de29f35c3a08d132 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_078.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_078 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_078() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_078()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_079.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13a4aeb58025650901fb9e2d3719b602a8834925 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_079.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_079 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_079() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_079()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_080.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e4a88b09447191192866a07cfe35f1beed71e1e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_080.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_080 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_080() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_080()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_081.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a951273e97ce1861ac617930bd5e6ad58e136f21 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_081.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an assignment of a component variable (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_081 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_081() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_081()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_082.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd2c5e5fac3cd87976f1de67037171c32162b085 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_082.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual out parameter (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_082 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_082() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_082()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_083.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa3d75e36d84feb9be6c5181e3c1efa064c13c92 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_083.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual inout parameter (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_083 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_083() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_083()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_084.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87f51019066279557f9b4362e1c7becd80eb3ccc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_084.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_084 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_084() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_084()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_085.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66b31d5cc28c725e95d64ee9933f7251f4fd5403 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_085.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_085 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_085() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_085()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_086.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ae1ca90be60fd51211e704109cc63870fd92618 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_086.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in a function called during receiving operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_086 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_086() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_086()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_087.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d687b3688533a19b59105796928d9a893f185a73 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_087.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_087 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_087() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_087()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_088.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6022c02b814ebc33bf5b624ae57e268a6fc898f8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_088.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_088 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_088() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_088()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_089.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36f9c6a9ae565473af9a0b87c585fb5808cc14af --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_089.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_089 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_089() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_089()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_090.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0cdf3c0c9a9edf291248f294d2e2feccc9fa36b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_090.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_090 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_090() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_090()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_091.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_091.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d96e08a35f2da77f1789d54459c11b00133d149 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_091.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_091 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_091() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_091()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_092.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_092.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2647c626a03ad486c9c4f53f11ac58f69442755 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_092.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_092 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_092() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_092()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_093.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_093.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e83b8fa27f95366c1eadc4567c4b8213088e51b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_093.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_093 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_093() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_093()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_094.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_094.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6268ac701c19f311ddb8749a89711c9b47da1cd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_094.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_094 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_094() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_ptc) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_094()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_095.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_095.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..802aaa3fdb0fe4b7651f178e17102b8a6453b36f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_095.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_095 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_095() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(R:{ field1 := f_test() }) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_095()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_096.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_096.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a2973ab32537f76530c921f418c7a21d2b073e5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_096.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(R:{ field1 := f_test() }) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_097.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_097.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..003045d5e6a545f0827283ef8928fbace79b7f21 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_097.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_097 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_097() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(R:{ field1 := f_test() }) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_097()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_098.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_098.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4470494ca8b40a6c647e1b71b7b10af14ce56ddc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_098.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_098 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_098() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(R:{ field1 := f_test() }) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_098()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_099.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_099.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e497437f4b241f9a4a26f2bb837834aec7a26cb2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_099.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_099 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_099() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_099()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_100.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_100.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80e7b651652f1b37e570fa8fb0b5601f3332fbdc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_100.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_100 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(R:{ field1 := 2 }); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_100() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_100()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_101.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_101.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..950e7c15d96786b6f03e71ab138c6a49f2211d6e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_101.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_101 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(R:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_101() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_101()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_102.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_102.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d63b296b6f6b5e1f0e45ee8961b7a1ee8566920 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_102.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_102 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(R:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_102() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_102()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_103.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_103.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..134b9f4a092d00043a24ba4beb297dc9f98797dd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_103.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_103 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_103() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_103()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_104.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_104.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad32d95d86e1d32560b5f92c374727d0c29cb2b8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_104.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_104 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_104() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_104()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_105.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_105.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0149a9e2c59d375d641d062121c16d7399ec76e0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_105.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_105 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_105() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_105()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_106.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_106.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ccd78cbcd71574f65a8763accfc6580d0a44d53 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_106.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_106 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_106() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_106()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_107.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_107.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9292e5349d86229d6b3c38594d84d024ba6a507d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_107.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_107 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_107() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_107()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_108.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_108.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..541f055de2a422d5c613569c11cbf7c68c100ef6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_108.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_108 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_108() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_108()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_109.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_109.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5bc80f9442f2206479a3b16616ec5c0b1911bf95 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_109.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_109 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_109() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_109()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_110.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_110.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bdfa1efb94d4b678f98b2076d41554f7c69a520 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_110.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_110 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_110() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_110()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_111.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_111.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a35bd4e3df49867bf09ddb4a9dae49b55f6909d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_111.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_111 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_111() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_111()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_112.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_112.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7497a7f594d42d2c819f5019bb7c5a6f374d6507 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_112.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_112 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_112() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_112()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_113.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_113.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4203f96b9a735a250b8906d59bbff9364997301b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_113.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_113 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_113() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_113()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_114.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_114.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d339364710d8c10df99b665181fa67060ac41b4b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_114.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_114 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_114() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_114()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_115.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_115.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46237ed042a8beab9bd93a53ee25e1d6c6c99932 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_115.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_115 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_115() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_115()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_116.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_116.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f04127476ad9f183570dadc4ca64812f1f7954e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_116.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_116 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_116() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_116()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_117.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_117.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13e414c1cec909e38a3db6e98c55466fbf11a0ad --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_117.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_117 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_117() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_117()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_118.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_118.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f44f56d0c1064c42d3ca53b808bced75b31b566a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_118.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_118 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_118() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_118()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_119.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_119.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9a4a20b2ea88d82cc3d4ec398dc1e619ae4235a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_119.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_119 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_119() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_119()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_120.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_120.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8bcc867ab5b0d59635f7fdf523e27567cc7eb28 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_120.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_120 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_120() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_120()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_121.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_121.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1aed06146954b5226a74939bef14cefa956d71e0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_121.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_121 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_121() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_121()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_122.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_122.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3180b9d03d76098645f9f52e0769603ab923ada1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_122.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an assignment of a component variable (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_122 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_122() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_122()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_123.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_123.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebcf363213effd28353c02ad691ee29c8aaa3820 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_123.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual out parameter (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_123 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_123() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_123()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_124.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_124.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19da8f5ad822cad7f6cad87ee10aa77230057208 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_124.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual inout parameter (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_124 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_124() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_124()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_125.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_125.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..704e4114f3189955f23e5c8ac63d801f4a9814f5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_125.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_125 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_125() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_125()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_126.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_126.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e78824da95ec0e8b32243f33b9f924c056c85c8c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_126.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_126 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_126() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_126()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_127.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_127.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7786265822a055368d4b78d29e8bd8a99b20d08c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_127.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in a function called during receiving operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_127 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_127() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_127()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_128.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_128.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1a1d4109cb0922bd2a49d6fb5a1b08adc76c3a3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_128.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an out parameter (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_128 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test(out integer p_out) runs on GeneralComp return template integer { + p_out := 1; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_128() runs on GeneralComp system GeneralComp { + var integer v_int; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_int) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_128()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_129.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_129.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fcf10baaf94d89669262e399376d3dc88ad7771f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_129.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an inout parameter (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_129 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test(out integer p_out) runs on GeneralComp return template integer { + p_out := 1; + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_129() runs on GeneralComp system GeneralComp { + var integer v_int := 0; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_int) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_129()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_130.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_130.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a417331a0f7a9531be7daf98f1247c1525a8d77 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_130.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_130 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var GeneralComp v_ptc := GeneralComp.create; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_130() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_130()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_131.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_131.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0564f23a18ee89c9707dcaba075205db6e98c588 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_131.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_131 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.start(f_ptcBehaviour()); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_131() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_131()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_132.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_132.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e7194338669f4bc28135c91df09bb1b23c542de --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_132.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_132 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.stop; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_132() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_132()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_133.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_133.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..822fec1692ae2456667f5b05e1d14dd2c206efd0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_133.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_133 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.kill; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_133() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_133()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_134.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_134.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e8eab7081dc80b75201d70f63f308fd9d660afa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_134.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_134 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.running) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_134() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_134()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_135.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_135.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2be11e50556220fc64b239f1c0ca5c0b6ffd6786 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_135.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_135 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return template integer { + if (p_ptc.alive) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_135() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_135()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_136.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_136.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d46c152c0d6e5d4b265c34e8588b6875074eb6cb --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_136.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_136 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.done; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_136() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_136()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_137.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_137.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b4033eaee6ed9a0303bf164ffa811bbfb051f7b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_137.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_137 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return template integer { + p_ptc.killed; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_137() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_ptc))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_137()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_138.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_138.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d883c93493ede4a6f6fb4e7aa57294c5bf4e33c5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_138.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_138 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.start; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_138() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(m_msg(f_test())) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_138()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_139.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_139.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c26bda8bc4c575af2f7b566ad9a466ccd8de7379 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_139.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.stop; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(m_msg(f_test())) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_140.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_140.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48d2a3009f91af63a938ad69fd1b3ce69cd7aa56 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_140.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_140 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.halt; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_140() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(m_msg(f_test())) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_140()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_141.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_141.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6466ad7553384a7b73be3084cca06264b67ad697 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_141.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_141 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.clear; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_141() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + alt { + [] p.receive(m_msg(f_test())) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_141()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_142.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_142.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d98b278dacc0c10aeff0168e73c454b4a90949ec --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_142.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_142 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (p.checkstate("Started")) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_142() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_142()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_143.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_143.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70d0075c7bf5629ea4712f09508be5e1fbb55e61 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_143.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_143 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.send(R:{ field1 := 2 }); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_143() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_143()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_144.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_144.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a636c4ef1a8acb39574fcad11f1569d7c929424 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_144.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_144 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.receive(R:?); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_144() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_144()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_145.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_145.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2141a827ae3b315824c82882f89b64fa79a7f51a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_145.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_145 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.trigger(R:?); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_145() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_145()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_146.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_146.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80276ee65a1cc3a0fe82c149bfe5d7dba955b7a9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_146.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_146 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return template integer { + psig.call(S:{}, nowait); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_146() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_146()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_147.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_147.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d7ed02a7da36f4dc78e3aa0a113f6a4c7d5faba --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_147.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_147 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.getcall(S:?); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_147() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_147()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_148.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_148.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4fd77c96dbd6a5d42db581aa4c76838495d0c01 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_148.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_148 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.reply(S:{}); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_148() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_148()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_149.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_149.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42175fbe229124d9eed9fa42900bd25eb5cae4ee --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_149.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_149 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return template integer { + psig.getreply(S:?); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_149() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_149()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_150.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_150.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..330222f0398e03ec75c72d64eed1fcc75a539fbe --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_150.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_150 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return template integer { + psig.raise(S, "UserException"); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_150() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(R:{ field1 := 1 }); + psig.getcall(S:?); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_150()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_151.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_151.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc14232ee3a623d1b27dca65c27c06c7fab5802d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_151.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_151 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return template integer { + psig.catch(S, charstring:?); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_151() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_151()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_152.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_152.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b55de81c93d5afe2bfa0c652972194aef59ac0a4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_152.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_152 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.check; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_152() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_152()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_153.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_153.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4a63c873276cd4f292a08edf057e8d71b429f66 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_153.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_153 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + connect(mtc:p, mtc:p); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_153() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_153()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_154.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_154.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e6310e50e91adc5aa938f155b08f91136bda2d9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_154.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_154 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + disconnect(mtc:p, mtc:p); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_154() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_154()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_155.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_155.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d5d696a0031d39f098410c781d76b73259a47d2a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_155.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_155 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + map(mtc:p, system:p); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_155() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_155()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_156.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_156.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..682a0cff579dd3bc77846abdc1ffb631cd8ccaaa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_156.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_156 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return template integer { + unmap(mtc:p, system:p); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_156() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_156()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_157.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_157.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad36b26ad55e0b7ae9011c07e227707a43b9168e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_157.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_157 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + action("My action"); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_157() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_157()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_158.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_158.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cba9a63422ab00ae949298fd0a3edb2c8469e819 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_158.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_158 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.start; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_158() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_158()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_159.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_159.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fcaee27d03aa230266160076e77d5248a495c29 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_159.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_159 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + tc_tmr.stop; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_159() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_159()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_160.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_160.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6077736cce734485ba4ccb6b05fe1118823cc95f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_160.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_160 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.running) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_160() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_160()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_161.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_161.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e321c03d16868e234add0bb4623bc988199407f2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_161.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_161 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + if (tc_tmr.read > 0.0) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_161() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_161()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_162.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_162.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16b562a864c8e738fda84385f5cde57e5f326dc5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_162.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_162 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return template integer { + any timer.timeout; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_162() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_162()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_163.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_163.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca25e243f2f107facd6a1ef91df1d7c7138581f1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_163.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_163 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return template integer { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_163() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_163()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_164.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_164.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b29481538c6a71c7ef30754a72de8f409efa600a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_164.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_164 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + if (rnd() > 0.5) { return ?; } + else { return 1; } + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_164() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_164()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_165.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_165.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e34aa481e7645652795ad2eeffac4e3a0bea07bf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_165.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an assignment of a component variable (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_165 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return template integer { + vc_int := 1; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_165() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_165()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_166.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_166.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a0c83c77b1b0d4885b223a959d833f6470b3e9b9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_166.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual out parameter (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_166 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_out(vc_int); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_166() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_166()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_167.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_167.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00807e21bbe66107b032d5fc7b6158253b668779 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_167.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain a component variable used as an actual inout parameter (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_167 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return template integer { + f_inout(vc_int); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_167() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_167()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_168.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_168.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c54828c3f0064e43dfed5ba29e3f667542340a10 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_168.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_168 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + setverdict(pass); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_168() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_168()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_169.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_169.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ba902dae4c7baa4c2fb280a80593e6f85c88c90 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_169.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_169 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + activate(a_anyTimer()); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_169() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_169()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_170.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_170.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2294c813fe2a9f73ae67e608eecc664ce4659ea --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_170.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in a function called during receiving operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_170 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return template integer { + deactivate; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_170() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_170()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_171.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_171.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba2efcaff2f11d039fb79664bafc2358041ae455 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_171.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an out parameter (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_171 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test(out integer p_out) runs on GeneralComp return template integer { + p_out := 1; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_171() runs on GeneralComp system GeneralComp { + var integer v_int; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_int))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_171()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_172.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_172.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b1dd0afffedfef336b85baa12dc0fe4a8b4c79d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_172.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called during receiving operation cannot contain an inout parameter (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_172 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test(out integer p_out) runs on GeneralComp return template integer { + p_out := 1; + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_172() runs on GeneralComp system GeneralComp { + var integer v_int := 0; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_int))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_172()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_173.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_173.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc3f633f01aa8c9389381554d939649f6fc287d4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_173.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_173 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var GeneralComp v_ptc := GeneralComp.create; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_173() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_173()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_174.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_174.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7a636d3b0f05dff6cd26246a20ff39804e5d577 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_174.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_174 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.start(f_ptcBehaviour()); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_174() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_174()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_175.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_175.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab4f91d4aa11a474383bd81b0e252ba3ed437d1a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_175.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_175 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.stop; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_175() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_175()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_176.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_176.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1934895d413eb02315284577edf1f8a29b2619a9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_176.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_176 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.kill; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_176() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_176()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_177.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_177.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f507ab56bc04721ec72c499de39580538b947f64 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_177.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_177 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.running) { return true; } + else { return false; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_177() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_177()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_178.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_178.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32b58cc996f650b67390fc454aa26c7d9bce38bc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_178.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_178 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.alive) { return true; } + else { return false; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_178() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_178()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_179.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_179.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fc23ac0e25bd2f5e1cfd651c1062edca167b432 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_179.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_179 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.done; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_179() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_179()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_180.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_180.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d3e1bbd398e77838c7871eaca1900fedd898354 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_180.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_180 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.killed; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_180() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_ptc)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_180()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_181.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_181.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d686d136b3cc5b3b87782a4869393c2f1971812 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_181.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_181 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.start; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_181() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_181()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_182.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_182.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c7b8fb1e8fa9a870f3c382384d82097105ac978 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_182.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.stop; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_183.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_183.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..670402422598515298a6cf9318a0ab1f10fab077 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_183.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_183 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.halt; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_183() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_183()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_184.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_184.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c37b3e85c1e0e00a019d18303cb8b653cbe7b223 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_184.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_184 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.clear; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_184() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_184()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_185.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_185.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f86c60ac5769d92ace27919c661184969b00ced2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_185.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_185 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (p.checkstate("Started")) { return true; } + else { return false; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_185() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_185()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_186.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_186.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..590c781e279925540a0753654af537e57db82a4f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_186.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_186 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.send(2); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_186() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_186()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_187.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_187.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f943832f81bc45137e40957a6e42718b57e332c7 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_187.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_187 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.receive(integer:?); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_187() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_187()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_188.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_188.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b613f4cfe424c2d7aaff2fdc6f7a7df92ca95a88 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_188.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_188 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.trigger(integer:?); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_188() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_188()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_189.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_189.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94410e6df4a0fe87b4062bf9832bdb523ec24ee5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_189.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_189 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return boolean { + psig.call(S:{}, nowait); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_189() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_189()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_190.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_190.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb3262c876e8623aae96ea7a3108561e1de2438e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_190.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_190 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.getcall(S:?); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_190() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_190()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_191.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_191.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58c6e353952e26eba6ba5ad971e95e4b1a5efc25 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_191.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_191 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.reply(S:{}); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_191() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_191()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_192.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_192.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e0e656ccc1d86a1053660b6622271b033c9f60b1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_192.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_192 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return boolean { + psig.getreply(S:?); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_192() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_192()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_193.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_193.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2fd068d06e9404b5d2f2aebc128e77f87a13738 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_193.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_193 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.raise(S, "UserException"); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_193() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_193()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_194.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_194.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b356ebaa4cd3851a554fad1666f214e4125ab85b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_194.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_194 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return boolean { + psig.catch(S, charstring:?); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_194() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_194()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_195.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_195.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54b14b4248af5154ed8f6cf6aa2ab213bea66001 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_195.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_195 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.check; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_195() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_195()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_196.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_196.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca7f576f130e7f690d848ae0984608df90ba067b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_196.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_196 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + connect(mtc:p, mtc:p); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_196() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_196()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_197.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_197.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f5e8704cc03b178f0779a59f638caed6fa426c34 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_197.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_197 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + disconnect(mtc:p, mtc:p); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_197() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_197()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_198.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_198.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28e31dea37e66e7dc17113bbe1a8ee616c090169 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_198.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_198 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + map(mtc:p, system:p); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_198() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_198()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_199.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_199.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d7884322b5e9590199b1758d971b3927197aa93 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_199.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_199 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + unmap(mtc:p, system:p); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_199() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_199()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_200.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_200.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66159f294f45fcdc8abd8f8c52e28396b72053a9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_200.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_200 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + action("My action"); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_200() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_200()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_201.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_201.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53ff019d6ff32887e340cbe81ab9f28fc7dcecf1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_201.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_201 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.start; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_201() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_201()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_202.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_202.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25953aa2adb265c25d29e37b31df96168a34e9c8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_202.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_202 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.stop; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_202() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_202()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_203.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_203.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..515391bb09fad6818f170e27a5ca7c54615c6c6a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_203.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_203 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 5.0; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.running) { return true; } + else { return false; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_203() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_203()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_204.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_204.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..169e37669e1e07a508d59eb4426f63d26660c985 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_204.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_204 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.read > 0.0) { return true; } + else { return false; } + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_204() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_204()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_205.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_205.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9853e10498423754185b3f3e6f42244a137e39d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_205.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_205 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + any timer.timeout; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_205() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_205()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_206.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_206.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43eef3cedf0648d2cc9cd0ce3c4c96a8de85ce2e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_206.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an alt statement cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_206 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return boolean { + vc_int := 1; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_206() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_206()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_207.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_207.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..797cd45dff555ae1923dc5483a15e392adb233cf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_207.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an alt statement cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_207 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_out(vc_int); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_207() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_207()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_208.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_208.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f624a8f616a7c122f7a788bac136708f95efbc86 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_208.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an alt statement cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_208 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_inout(vc_int); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_208() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_208()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_209.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_209.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6efc4405c0c4d7beadaf3578a8a8090049989cfa --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_209.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_209 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + activate(a_anyTimer()); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_209() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_209()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_210.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_210.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b31774354fb21eaa1aee9b3060a892d4e08c0eb8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_210.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in guards of alt statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_210 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + deactivate; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_210() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_210()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_211.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_211.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e042d0b69b7f2b1b9cdbd9c8b8cbff8e34f8cc2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_211.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called from a guard statement of an alt operation cannot contain out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_211 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(out integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_211() runs on GeneralComp system GeneralComp { + var integer v_int := 0; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_int)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_211()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_212.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_212.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..daecdd74eb024298a3a3894a495d2285b5247b1c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_212.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_212 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var GeneralComp v_ptc := GeneralComp.create; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_212() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_212()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_213.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_213.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81b0b5708e2c13f0282a844ace37ab45ed7ac4ca --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_213.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_213 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.start(f_ptcBehaviour()); + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_213() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_213()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_214.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_214.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a630b9bf7858a367aa2704ce719effdc6ceec0b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_214.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_214 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.stop; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_214() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_214()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_215.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_215.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..270dd4a93a5b5951788d21d84a2a4db9c7716f0d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_215.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_215 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.kill; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_215() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_215()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_216.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_216.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b742bcb62a0d56e694f9122efcd037d84ed7570 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_216.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_216 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.running) { return true; } + else { return false; } + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_216() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_216()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_217.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_217.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..922d466d277e0827d0548fb7363e5549b60e6753 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_217.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_217 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.alive) { return true; } + else { return false; } + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_217() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_217()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_218.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_218.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e3d5b99e1f17f8621b018f6665f82cb520f7603 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_218.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_218 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.done; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_218() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_218()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_219.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_219.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa3c9d60bf208975d2b2d4f0459d6573a1beac4b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_219.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_219 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.killed; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + [f_test(p_ptc)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_219() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_219()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_220.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_220.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27d20a70967930052175711ef0aa3d871e5a91c9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_220.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_220 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.start; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_220() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_220()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_221.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_221.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fb87956d5aa9d293be17761b1defc90efceb8e2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_221.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.stop; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_222.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_222.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6158bd1a1950bfa9b30919045deaf383d514520d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_222.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_222 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.halt; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_222() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_222()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_223.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_223.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e654056ec070858c3d0449c284d92e9effaa7550 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_223.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_223 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.clear; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_223() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_223()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_224.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_224.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1db4f78449c52f4d12655202b831b7feeb638f5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_224.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_224 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (p.checkstate("Started")) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_224() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_224()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_225.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_225.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98ea848b0f98b95331571c2c7c89ac1d6090db3b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_225.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_225 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.send(2); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_225() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_225()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_226.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_226.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ada4e25ce7f7221834c3fe9cddbb2725c87c6d2b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_226.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_226 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.receive(integer:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_226() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_226()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_227.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_227.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dafbe9a89380ce11531efb55a3415d5630573b31 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_227.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_227 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.trigger(integer:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_227() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_227()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_228.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_228.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4840ef1f7d7cdfb5fdf408c0c0d931266c5642c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_228.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_228 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return boolean { + psig.call(S:{}, nowait); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_228() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_228()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_229.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_229.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4199e2b279e1519a8dcbfed46c4501bc9e73562 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_229.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_229 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.getcall(S:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_229() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_229()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_230.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_230.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..622378acfe8bcec9b1df3175c081b8d1fd77d823 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_230.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_230 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.reply(S:{}); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_230() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_230()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_231.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_231.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..381d4031ce018c787ac23f2bc4ff669808c6b98e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_231.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_231 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return boolean { + psig.getreply(S:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_231() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_231()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_232.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_232.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd9b2cfda71bb49c16d448e81b37fc53c1262b4b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_232.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_232 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.raise(S, "UserException"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_232() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_232()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_233.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_233.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2eb62edc7d879f1b9010346663ea7d95bf4fc5bf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_233.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_233 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return boolean { + psig.catch(S, charstring:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_233() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_233()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_234.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_234.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02b57f24f4322065e6358edb30db43746225f9fb --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_234.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_234 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.check; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_234() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_234()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_235.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_235.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ac70f4fc7ce6a6b1df442accaaafdc2535fd3e3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_235.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_235 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + connect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_235() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_235()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_236.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_236.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6908ac45c248d881450e0d955cdb7b346a2396ca --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_236.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_236 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + disconnect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_236() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_236()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_237.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_237.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ffa068da2b100b78fe3990a83340ff64a0ed884e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_237.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_237 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + map(mtc:p, system:p); + return true; + } + + altstep a_rcv() runs on GeneralComp system GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_237() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_237()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_238.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_238.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7147c963a4be2d2b62da4d84314c5cccdd96553c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_238.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_238 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + unmap(mtc:p, system:p); + return true; + } + + altstep a_rcv() runs on GeneralComp system GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_238() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_238()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_239.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_239.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b087862dc65064a6c860414888ca165cd944bcf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_239.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_239 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + action("My action"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_239() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_239()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_240.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_240.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3a80c235001a7edf5af2009ae391f38127c2b98 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_240.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_240 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.start; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_240() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_240()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_241.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_241.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4df4e793d2dc660e36e9d9e1cc3d46ee915adef1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_241.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_241 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.stop; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_241() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_241()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_242.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_242.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c94683e098a7846d45fc47e2adc06d46753293d7 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_242.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_242 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 5.0; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.running) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_242() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_242()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_243.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_243.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e608f893353d377604d099787088b9f8d62a6b7e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_243.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_243 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.read > 0.0) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_243() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_243()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_244.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_244.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64c80d829cf9bb4efa6151f58f3aeb5003e39b0d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_244.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_244 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + any timer.timeout; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_244() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_244()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_245.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_245.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc89cd1f1f6b60a0fc65b464a8468b2cebf8dc04 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_245.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in guards of altsteps + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_245 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return boolean { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return true; } + else { return true; } + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_245() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_245()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_246.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_246.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26efb08b8608f49c8c29c647a66166da433d2315 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_246.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_246 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (rnd() > 0.5) { return true; } + else { return true; } + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_246() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_246()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_247.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_247.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebd54042844687b84f39f811a1eea5e80106edeb --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_247.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an altstep cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_247 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return boolean { + vc_int := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_247() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_247()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_248.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_248.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c77ff27dc14f3452fb057b81a6baa1106658e686 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_248.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an altstep cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_248 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_out(vc_int); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_248() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_248()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_249.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_249.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..914c298ea711e6749179418106d403b49d9bdf71 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_249.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in a guard of an altstep cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_249 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_inout(vc_int); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_249() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_249()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_250.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_250.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..260147f7036123e86ddbcd65a1cdbca07b2c8404 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_250.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in guard statements of altstep + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_250 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + setverdict(pass); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_250() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_250()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_251.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_251.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..404221058ddca464530aef8e5f7916d856e3519b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_251.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_251 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + activate(a_anyTimer()); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_251() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_251()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_252.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_252.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33144275a81732ffc8f2cb05332c10064b847517 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_252.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in guards of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_252 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + deactivate; + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_252() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_252()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_253.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_253.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ff207e73b126b215bbf4a528cd773ecbea656e6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_253.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called from a guard statement of an altstep cannot contain out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_253 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(out integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var integer v_int := 0; + [f_test(v_int)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_253() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_253()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_254.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_254.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3d8eb002add39f226f69da552fcea43b42d5563 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_254.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called from a guard statement of an altstep cannot contain inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_254 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(inout integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var integer v_int := 0; + [f_test(v_int)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_254() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_254()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_255.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_255.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b77c0a0c050f20c82163f358344ce37267e0fc71 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_255.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the create operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_255 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var GeneralComp v_ptc := GeneralComp.create; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_255() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_255()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_256.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_256.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa825bed8080d8f2b9f671d940613b8c6ce5af2f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_256.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.start operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_256 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.start(f_ptcBehaviour()); + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_256() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_256()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_257.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_257.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75a00c4874ec4a316e2f683a2ca67d9e01af2e15 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_257.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.stop operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_257 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.stop; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_257() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_257()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_258.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_258.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e50bcf95c29aca4607670248a2252bfbca354d20 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_258.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the kill operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_258 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.kill; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_258() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_258()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_259.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_259.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa7d647c05d2c81b0d10f88db3322d310e0ca38b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_259.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the component.running operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_259 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.running) { return true; } + else { return false; } + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_259() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_259()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_260.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_260.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2840f3d68367ef657efaf6edbf4fcc69c3d0258b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_260.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the alive operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_260 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.alive) { return true; } + else { return false; } + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_260() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_260()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_261.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_261.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ff9b7c2575bc3b9834fc3ec8c3476dd18dd41ee --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_261.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the done operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_261 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.done; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_261() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_261()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_262.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_262.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b0c9d6cdf643b7ae0cc56a902f071cfcb84a009 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_262.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the killed operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// a) All component operations, i.e. create, start (component), stop (component), kill, running (component), +// alive, done and killed (see notes 1, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_262 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.killed; + return true; + } + + altstep a_rcv(GeneralComp p_ptc) runs on GeneralComp { + var boolean v_guard := f_test(p_ptc); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_262() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(v_ptc); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_262()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_263.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_263.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b5b1ab2e49779da0d8ca6c2f0023e01d524a3459 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_263.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.start operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_263 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.start; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_263() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_263()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_264.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_264.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33c6d87203d95b52b38ffbac4227ad6baaa3450f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_264.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the port.stop operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.stop; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_265.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_265.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4cefb32632e95d1dcef396ec3c9fe988d6b67b6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_265.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the halt operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_265 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.halt; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_265() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_265()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_266.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_266.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33253c937baec66bea5f5453020ec979e8942fd1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_266.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the clear operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_266 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.clear; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_266() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_266()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_267.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_267.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05ca811af273fd1bb83b780b40721fcb1efa511a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_267.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the checkstate operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_267 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (p.checkstate("Started")) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_267() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_267()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_268.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_268.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9cfbbc971fa5a24780e59f8ac70da547e2321c2b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_268.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the send operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_268 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.send(2); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_268() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_268()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_269.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_269.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea62c029d81fbc9214b2978a804cc2ba4f40b6f6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_269.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the receive operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_269 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.receive(integer:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_269() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_269()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_270.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_270.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e4f84a614bf861257ff83468a1e5c40a1f1220d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_270.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the trigger operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_270 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.trigger(integer:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_270() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_270()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_271.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_271.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f79d78c0cc7e5fed4689e46a17f9009f90718e29 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_271.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the call operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_271 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return boolean { + psig.call(S:{}, nowait); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_271() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_271()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_272.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_272.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..400b72723f1d79bcdf30f83d7a65decddaf896f1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_272.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getcall operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_272 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.getcall(S:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_272() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_272()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_273.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_273.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f637a75cd7cf821d1c125ef413babdb8891cc1d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_273.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the reply operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_273 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.reply(S:{}); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_273() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_273()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_274.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_274.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1aedc65165353126ab3a6a321e7ce7c36e1d7cfc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_274.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the getreply operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_274 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return boolean { + psig.getreply(S:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_274() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_274()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_275.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_275.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6ff22bc96a60e560103810ad48276c31a9da722 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_275.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the raise operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_275 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.raise(S, "UserException"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_275() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_275()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_276.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_276.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b20474ca85c15f3c0e1c8fb1c0926f195e725516 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_276.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the catch operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_276 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return boolean { + psig.catch(S, charstring:?); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_276() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_276()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_277.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_277.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b07fda467e48547c74b728c90038de1a662e84bd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_277.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the check operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_277 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.check; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_277() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_277()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_278.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_278.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14c9eab8e90e4dcede6c1acc44f8fa6433d19599 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_278.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the connect operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_278 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + connect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_278() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_278()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_279.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_279.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..802c00de79ac5a8abc47d4f0d41ee8fcc38ab802 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_279.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the disconnect operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_279 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + disconnect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_279() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_279()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_280.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_280.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a38a021a30bed203e2e8573919c9a2e7a6ab4d2f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_280.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the map operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_280 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + map(mtc:p, system:p); + return true; + } + + altstep a_rcv() runs on GeneralComp system GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_280() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_280()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_281.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_281.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9974b52cfa19cdbcc9ec83f602e7ce467d60873c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_281.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the unmap operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// b) All port operations, i.e. start (port), stop (port), halt, clear, checkstate, send, receive, trigger, call, +// getcall, reply, getreply, raise, catch, check, connect, disconnect, map and unmap (see notes 1, 2, 3, 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_281 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + unmap(mtc:p, system:p); + return true; + } + + altstep a_rcv() runs on GeneralComp system GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_281() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_281()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_282.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_282.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4f37b81d23394ab3d88f7e2aa7c66593f48e655 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_282.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the action operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// c) The action operation (see notes 2 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_282 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + action("My action"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_282() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_282()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_283.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_283.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..739200f18e04ff887802c6da2a2347a4b7ada3df --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_283.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.start operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_283 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.start; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_283() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_283()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_284.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_284.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed767a5b981e2ce41db168be9005a58b56840d0f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_284.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.stop operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_284 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.stop; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_284() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_284()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_285.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_285.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12da5c15c32078c0049ff3739b2841b4a1a22bd9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_285.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timer.running operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_285 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 5.0; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.running) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_285() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_285()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_286.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_286.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8ddadabfe7bdb03609005e7e3c60214d3d15ffd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_286.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the read operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_286 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.read > 0.0) { return true; } + else { return false; } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_286() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_286()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_287.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_287.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..161a09436a6515de3d7b24f03d804319790887e0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_287.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the timeout operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// d) All timer operations, i.e. start (timer), stop (timer), running (timer), read, timeout (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_287 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + any timer.timeout; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_287() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_287()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_288.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_288.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c1971705236d2a78192eb2f70f25c74fb10dfca --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_288.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a non-deterministic external function call cannot be used in altstep local definitions + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// e) Calling non-deterministic external functions, i.e. external functions where the resulting values for actual +// inout or out parameters or the return value may differ for different invocations with the same actual in and +// inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_288 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_160104_invoking_functions_from_specific_places_001() return boolean; + + function f_test() runs on GeneralComp return boolean { + if (xf_NegSem_160104_invoking_functions_from_specific_places_001()) { return true; } + else { return true; } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_288() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_288()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_289.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_289.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..baf63e9266c319f8eb7067754401e6140c0702f3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_289.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the predefined rnd function cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// f) Calling the rnd predefined function (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_289 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (rnd() > 0.5) { return true; } + else { return true; } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_289() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_289()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_290.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_290.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12f943cd2d87e7119baed052b7e2703a8902b4f8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_290.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in an altstep local definition cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_290 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return boolean { + vc_int := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_290() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_290()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_291.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_291.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4612c05d17c1dd8cc01a94bdce5cecd07b8254b3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_291.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in an altstep local definition cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_291 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_out(vc_int); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_291() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_291()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_292.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_292.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8babbe5c334e77fd5746f59eb961caba1b924c0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_292.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify a function called in an altstep local definition cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments, +// and in the instantiation of out and inout parameters (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_292 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_inout(vc_int); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_292() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_292()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_293.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_293.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f34be5b51302a44a0bf056bb91c8ec9be4722202 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_293.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the setverdict operation cannot be used in guard statements of altstep + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// h) Calling the setverdict operation (see notes 4 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_293 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + setverdict(pass); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_293() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_293()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_294.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_294.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be7cec7399970a4f18db06148c247c8d395bf647 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_294.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the activate operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_294 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + activate(a_anyTimer()); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_294() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_294()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_295.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_295.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8015874c93ed6f117dca0718bcb8a21c12fc34ea --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_295.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that the deactivate operation cannot be used in altstep local definitions + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// i) Activation and deactivation of defaults, i.e. the activate and deactivate statements (see notes 5 and 6). + +module NegSem_160104_invoking_functions_from_specific_places_295 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + deactivate; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_295() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_295()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5665a8c85cacfeab1e010b67a8eb85198253c472 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_296.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in altstep local definitions cannot contain out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_296 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(out integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var integer v_int := 0; + var boolean v_guard := f_test(v_int); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_296() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_296()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d05afbe88b8984830756fec4ea5514b476b9cf25 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_297.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in altstep local definitions cannot contain inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// j) Calling functions and deterministic external functions with out or inout parameters (see notes 7 and 8). + +module NegSem_160104_invoking_functions_from_specific_places_297 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(inout integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv() runs on GeneralComp { + var integer v_int := 0; + var boolean v_guard := f_test(v_int); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_297() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_297()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_298.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_298.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..354ac323a9d174ad785da7ee97a0b767bc825d7a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_298.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy parameters (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_298 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..p_par); + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_298() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + template @fuzzy integer mw_test := f_test(v_int); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_298()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_299.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_299.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba03b665cd37456b51f1c9c8b02af79c71f5df7f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_299.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called during receiving operation cannot contain fuzzy parameters (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_299 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_299() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + template @fuzzy integer mw_test := f_test(v_int); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_299()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_300.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_300.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5701547a0dca40313253293b58d60bff3f7e02b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_300.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy variables (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_300 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_300() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_300()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_301.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_301.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24a50869d66418c816ba401307eabfef7ff8ad8b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_301.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain the setencode operation (in templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_301 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(integer, "Binary"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_301() runs on GeneralComp system GeneralComp { + template @fuzzy integer mw_test := f_test(); + connect(mtc:p, mtc:p); + p.send(1); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_301()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_302.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_302.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2442776e8e5069b73ee704ba0985771ed82d1ba1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_302.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy parameters (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_302 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..p_par); + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_302() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + template @fuzzy R mw_test := { field1 := f_test(v_int) }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_302()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_303.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_303.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ba6165e837d0a4b7b01afde167042065378faf0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_303.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called during receiving operation cannot contain fuzzy parameters (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_303 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_303() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + template @fuzzy R mw_test := { field1 := f_test(v_int) }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_303()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_304.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_304.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b48018379f4691b2385821863e13162be44282a9 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_304.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy variables (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_304 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_304() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_304()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_305.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_305.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2959af7ce1b26987525a66503e366ec70e2f1854 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_305.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain the setencode operation (in template fields) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_305 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(R, "Binary"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_305() runs on GeneralComp system GeneralComp { + template @fuzzy R mw_test := { field1 := f_test() }; + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(mw_test); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_305()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_306.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_306.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1e7b780a9b8db1ccd2184b049da9054ad3ddb3d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_306.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy parameters (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_306 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..p_par); + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_306() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_int) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_306()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_307.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_307.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20f95c517fd17069b756bbaec83f9dff2b0d18e4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_307.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called during receiving operation cannot contain fuzzy parameters (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_307 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_307() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test(v_int) }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_307()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_308.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_308.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9a28c04258abd9fc29088de132c0c9c2b0c9c03 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_308.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy variables (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_308 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_308() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_308()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_309.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_309.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e06b9aa3b9e7208921c95d581f3f27af392ef79 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_309.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain the setencode operation (in in-line templates) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_309 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(R, "Binary"); + return ?; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_309() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(R:{ field1 := f_test() }); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_309()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_310.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_310.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebeb59aa8684f786b4ed0351d356c98e6ece2fbe --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_310.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy parameters (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_310 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return template integer { + return (0..p_par); + } + + function f_eval() return integer { + return 10; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_310() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_int))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_310()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_311.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_311.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57c30b7563bb81029cb21babf756baecbae2431b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_311.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called during receiving operation cannot contain fuzzy parameters (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_311 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return template integer; + + function f_eval() return integer { + return 10; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_311() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test(v_int))); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_311()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_312.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_312.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..554714b62884bef80b95f9786a3e48f4eafa689f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_312.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain fuzzy variables (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_312 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() return template integer { + var @fuzzy integer v_int := f_eval(); + return (0..v_int); + } + + function f_eval() return integer { + return 100; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_312() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_312()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_313.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_313.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96618942a7a25c180b66817fe5adf15424b06714 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_313.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called during receiving operation cannot contain the setencode operation (as actual parameters) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_313 { + type record R { + integer field1 + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return template integer { + p.setencode(R, "Binary"); + return ?; + } + + template R m_msg (template integer p_par) := { + field1 := p_par + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_313() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(R:{ field1 := 1 }); + p.receive(m_msg(f_test())); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_313()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_314.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_314.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f44eff1d07923f386d576a30a9ca61e629686c6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_314.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of alt statements cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_314 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(@fuzzy integer p_par) return boolean { + if (p_par > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_314() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_int)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_314()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_315.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_315.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24a61dddd0e40d89fe012fe29f6af1f5a9166457 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_315.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called in guards of alt statements cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_314 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + external function @deterministic f_test(@fuzzy integer p_par) return boolean; + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_314() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test(v_int)] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_314()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_316.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_316.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f5ea0f788316f26183dfb5d5db557111ada450f8 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_316.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of alt statements cannot contain fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_316 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var @fuzzy integer v_int := f_eval(); + if (v_int > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 100; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_316() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_316()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_317.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_317.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..294c720fb041a4e0ccacf40791b37eac71fb0323 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_317.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of alt statements cannot contain the setencode operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_317 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.setencode(integer, "Binary"); + return true; + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_317() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [f_test()] p.receive(integer:?) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_317()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_318.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_318.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80547e9eb1cc8c021d15c66b44b97964f3faff40 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_318.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of altsteps cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_318 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + function f_test(@fuzzy integer p_par) return boolean { + if (p_par > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 10; + } + + altstep a_rcv() runs on GeneralComp { + [f_test(v_int)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_318() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_318()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_319.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_319.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3079d2b3caeb0377767ab22c730d935b40ee64ba --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_319.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called in guards of altsteps cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_319 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + external function @deterministic f_test(@fuzzy integer p_par) return boolean; + + function f_eval() return integer { + return 10; + } + + altstep a_rcv() runs on GeneralComp { + [f_test(v_int)] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_319() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_319()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_320.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_320.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a227b02d137343d352e5094f3bd4a001c84ff797 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_320.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of altsteps cannot contain fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_320 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var @fuzzy integer v_int := f_eval(); + if (v_int > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 100; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_320() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_320()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_321.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_321.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86cf34946bceb8739d566e780348f85f39fe38b5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_321.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in guards of altsteps cannot contain the setencode operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_321 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.setencode(integer, "Binary"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + [f_test()] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_321() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_321()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_322.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_322.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ef12ec30151e0625eedfaafbb6843a1c993d4de --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_322.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in local definitions of altsteps cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_322 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + function f_test(@fuzzy integer p_par) return boolean { + if (p_par > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 10; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(v_int); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_322() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_322()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_323.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_323.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4943d5b532d22e99030aeef6e1fa5ee6659246ea --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_323.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that an external function called in local definitions of altsteps cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_323 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + external function @deterministic f_test(@fuzzy integer p_par) return boolean; + + function f_eval() return integer { + return 10; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(v_int); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_323() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_323()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_324.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_324.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e81ac84c4b875105c5dc6535838311096da7a54 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_324.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in local definitions of altsteps cannot contain fuzzy variables + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// k) Calling functions and external functions with @fuzzy formal parameters and variables (see notes 4 and 9). + +module NegSem_160104_invoking_functions_from_specific_places_324 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var @fuzzy integer v_int := f_eval(); + if (v_int > 0) { + return true; + } else { + return false; + } + } + + function f_eval() return integer { + return 100; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_324() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_324()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_325.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_325.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94cce7af9f18bc21a8a2eb627ca2a0967536cafc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160104_invoking_functions_from_specific_places/NegSem_160104_invoking_functions_from_specific_places_325.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.1.4, verify that a function called in local definitions of altsteps cannot contain the setencode operation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// If value returning functions are called in receiving communication operations (in templates, template fields, +// in-line templates, or as actual parameters), in guards or events of alt statements or altsteps (see clause 20.2), +// or in initializations of altstep local definitions (see clause 16.2), the following operations shall not be +// used in functions called in the cases specified above, in order to avoid side effects that cause changing the +// state of the component or the actual snapshot and to prevent different results of subsequent evaluations +// on an unchanged snapshot: +// l) The setencode operation (see note 8 and clause 27.9). + +module NegSem_160104_invoking_functions_from_specific_places_325 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.setencode(integer, "Binary"); + return true; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_guard := f_test(); + [v_guard] p.receive(integer:?) {} + } + + testcase TC_NegSem_160104_invoking_functions_from_specific_places_325() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + a_rcv(); + setverdict(pass); + } + + control { + execute(TC_NegSem_160104_invoking_functions_from_specific_places_325()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c462acfd65b4fd1cfab7632fc260655c388f75f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_001 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) return float { + + return p_integer+1; // mismatch between return type and argument type + return p_integer+2; +} + +testcase TC_NegSem_1601_toplevel_001 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_NegSem_1601_toplevel_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..942557dab03f8803a69388ae3f42e3c6ac9b7d83 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_002 { + +type component GeneralComp { +} + +function f_test ( template octetstring p_ostring ) return octetstring { + return p_ostring; // mismatch between return type and template argument +} + +testcase TC_NegSem_1601_toplevel_002 () runs on GeneralComp { + if( match('FFFFFF'O, f_test('FF??'O)) ) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control{ + execute(TC_NegSem_1601_toplevel_002()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65c59045669ef69f0537661ebd79e3dde61ebc6f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_003.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_003 { + + +type component GeneralComp { + var integer v_comp:=1; +} + +function f_test ( integer p_integer := 0 ) return integer { + + return f_two(p_integer); //against restriction 16.1 / a) +} + +function f_two ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+v_comp; +} + + +testcase TC_NegSem_1601_toplevel_003 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_NegSem_1601_toplevel_003()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f227200cd988529b93ed2637a99bb9d18adeca7f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_004 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+1; +} + +testcase TC_NegSem_1601_toplevel_004 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + f_test(1); //attempt to invoke a function with runs on clause + execute(TC_NegSem_1601_toplevel_004()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..965a99f074aaff8f163edbf59b228a927f42d945 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_005.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_005 { + + +type component GeneralComp { +} + +function f_test (inout integer p_integer := 10 ) return integer { + if (p_integer > 5) { + p_integer := 5; + return p_integer; + } + // there is no return value if comparison is false + +} + +testcase TC_NegSem_1601_toplevel_005 () runs on GeneralComp { + + if(f_test(2)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_NegSem_1601_toplevel_005()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f43e8f86b6163eed7f30bc26a7df1e05d49041b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/NegSem_1601_toplevel_006.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_1601_toplevel_006 { + + +type component GeneralComp { + var integer v_comp:=1; +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return f_two(p_integer); +} + +function f_two ( integer p_integer := 0 ) return integer { + + return p_integer+v_comp; //use of variable from a component but missing 'runs on' clause +} + + +testcase TC_NegSem_1601_toplevel_006 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_NegSem_1601_toplevel_006()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f59dd7af83979870fd99049630b4102be87e5067 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1601_toplevel_001 { + + +type component GeneralComp { +} + +function f_test ( integer p_integer := 0 ) return integer { + + return p_integer+1; + return p_integer+2; +} + +testcase TC_Sem_1601_toplevel_001 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_Sem_1601_toplevel_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..453d11cfc6608cd4293bd34096913f6764416f00 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1601_toplevel_002 { + + type component GeneralComp { + } + + function f_test ( template octetstring p_ostring ) return template octetstring { + + return p_ostring & p_ostring; + } + + testcase TC_Sem_1601_toplevel_002 () runs on GeneralComp { + + if( match('FFFFFFFF'O, f_test('FF?'O)) ) { + setverdict(pass); + } + else { + setverdict(fail); + } + + } + + + control{ + + execute(TC_Sem_1601_toplevel_002()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fac01f12c14327cee24d514342945528ef2bf05 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_toplevel_003.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.1, Ensure that the IUT correctly handles function definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1601_toplevel_003 { + + +type component GeneralComp { + var integer v_comp:=1; +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return f_two(p_integer); +} + +function f_two ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+v_comp; +} + + +testcase TC_Sem_1601_toplevel_003 () runs on GeneralComp { + + if(f_test(1)==2) { + setverdict(pass); + } + else { + setverdict(fail); + } + +} + + +control{ + + execute(TC_Sem_1601_toplevel_003()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSem_160201_invoking_altsteps_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSem_160201_invoking_altsteps_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55ca6a1cbe787c676fad36ce4a00bad63c8b8adc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/NegSem_160201_invoking_altsteps_001.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_160201_invoking_altsteps_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type port simplePort message { + inout integer + } + + type component GeneralComp { + port loopbackPort messagePort + } + + type component AltComp { + port simplePort messagePort + } + + + +altstep AltSet1() runs on AltComp { //incompatible component with GeneralComp + + [] messagePort.receive { + setverdict(pass); + } + +} + +testcase TC_NegSem_160201_invoking_altsteps_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + + alt { + [] AltSet1(); + [] t_timer.timeout { + setverdict(pass); + } + } + +} + +control{ + + execute(TC_NegSem_160201_invoking_altsteps_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c23143349bf3963e6f1f2149e7839439bbaddab --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_001.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_160201_invoking_altsteps_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + + +altstep AltSet1() runs on GeneralComp { + + [] messagePort.receive { + setverdict(pass); + } + +} + +testcase TC_Sem_160201_invoking_altsteps_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + + alt { + [] AltSet1(); + [] t_timer.timeout { + setverdict(pass); + } + } + +} + +control{ + + execute(TC_Sem_160201_invoking_altsteps_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0de7e7e30a335baea43d081ab057c3247a1567d3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_002.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_160201_invoking_altsteps_002 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + +altstep AltSet1() runs on GeneralComp { + + [] messagePort.check { + setverdict(inconc); + } + +} + +altstep AltSet2() runs on GeneralComp { + + [] messagePort.receive { + setverdict(pass); + } + +} + +testcase TC_Sem_160201_invoking_altsteps_002 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + + alt { + [] AltSet2(); + [] AltSet1(); //evaluation of sequential altstep activations + [] t_timer.timeout { + setverdict(fail); + } + } + +} + +control{ + + execute(TC_Sem_160201_invoking_altsteps_002()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72cd6cb4bfe5d67c06b00516d54cfa165b8a954b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_003.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that altsteps are correctly handled for dynamically mapped ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Mycompport A is dynamically mapped +module Sem_160201_invoking_altsteps_003{ + + type port loopbackPort message { + inout integer + } + + type port IntegerOutputPortType message { + inout integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } + +altstep AltStep1() runs on GeneralComp { + + [] MycomportA.receive { + } +} + + +// MyTestSystemInterface is the test system interface +testcase TC_Sem_160201_invoking_altsteps_003() runs on GeneralComp system MyTestSystemInterface { + timer tc_timer := 1.0; + map(mtc:MycomportA, system:messagePort); + + + MycomportA.send(2); + tc_timer.start; + unmap(mtc:MycomportA); + setverdict(pass); + + alt { + [] AltStep1(); + [] tc_timer.timeout { + setverdict(pass); + } + } +} +control{ + execute(TC_Sem_160201_invoking_altsteps_003()); +} +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cdcfdeebe692e7d237563996e7bf4e2332c9962 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/160201_invoking_altsteps/Sem_160201_invoking_altsteps_004.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:16.2.1, Ensure that altsteps are correctly handled for dynamically mapped ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Mycompport A is dynamically mapped +module Sem_160201_invoking_altsteps_004{ + + type port loopbackPort message { + inout integer + } + + type port IntegerOutputPortType message { + inout integer + } + +type component GeneralComp + { + timer tc_timer := 0.1; + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } + +altstep AltStep1() runs on GeneralComp { + + [] tc_timer.timeout { + MycomportA.clear; + setverdict(pass); + } +} + + +// MyTestSystemInterface is the test system interface +testcase TC_Sem_160201_invoking_altsteps_004() runs on GeneralComp system MyTestSystemInterface { + map(mtc:MycomportA, system:messagePort); + + + MycomportA.send(2); + tc_timer.start; + unmap(mtc:MycomportA); + + alt { + [] AltStep1(); + } +} +control{ + execute(TC_Sem_160201_invoking_altsteps_004()); +} +} \ No newline at end of file diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..deda6551cd950b8df7d666533edbcd9203049e8e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_001.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ +module NegSem_1602_toplevel_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + /** + * @desc function returns always 1 + * @return always 1 + */ + external function xf_NegSem_1602_toplevel_001() return integer; + + + altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := xf_NegSem_1602_toplevel_001(); //attempt to use external function for variable initialization + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_001 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_001()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..812176b517425aa1616baa81bbd2020fed31754d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_002.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_002 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + + altstep AltSet1() runs on GeneralComp { + var float v_LocalVar := rnd(); //calling rnd for local variable initialization + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_002 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_002()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..189e08f8c0bcdb3c6f6e758666fd189272962d10 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_003.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_003 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test() return boolean { + setverdict(inconc); //setting verdict within a function for altstep variable initialization + return true; + } + + + altstep AltSet1() runs on GeneralComp { + var boolean v_LocalVar := f_test(); + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_003 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_003()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b458ed48fdb72c53db2514b4e24c9c2fffe67fdc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_004.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_004 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test(inout integer p_int) return integer { + //use of inout parameter within a function called at altstep variable initialization + return p_int+1; + } + + + altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar1 := 1; + var integer v_LocalVar2 := f_test(v_LocalVar1); // call of functions with inout params forbidden by 16.1.4 j) + 16.2.b) + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_004 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_004()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59ebcc436cd2bf572ab275b42b2c6d2a91e9640d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_005.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_005 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + + altstep AltSet1() { //altstep port operations without corresponding component reference + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_005 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_005()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62195f32268bae0babb85d88e95b1476624fcc97 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_006.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSem_1602_toplevel_006 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test(integer p_int) runs on GeneralComp return boolean { //use of a function with runs on clause from an altstep without a runs on clause + if (p_int==1) { return true; } + } + + + altstep AltSet1() { + var integer v_LocalVar1 := 1; + + [] f_test(v_LocalVar1) { + setverdict(pass); + } + + } + + testcase TC_NegSem_1602_toplevel_006 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSem_1602_toplevel_006()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_007.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbcaf2c8a138079f2e25b365b2ffa9d8f5eeb75b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_007.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1, verify that altstep without a runs on clause cannot be started as component behaviour + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Altsteps started by using the start test component operation shall always have a runs on clause (see clause 22.5) +// and are considered to be invoked in the component to be started, i.e. not locally. However, the start test component +// operation may be invoked within behaviours without a runs on clause. + +module NegSem_1602_toplevel_007 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test() { + [] any port.receive { + setverdict(pass); + } + } + + testcase TC_NegSem_1602_toplevel_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + v_ptc.start(a_test()); + v_ptc.done; + } + + control { + execute(TC_NegSem_1602_toplevel_007()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_008.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e855aafb79ecb2f792b0e6a53ef18afa76dd3613 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_008.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the create operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_008 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var GeneralComp v_ptc := GeneralComp.create; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_008() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_008()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_009.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ca594696240e37ef6f7efd15daa5eaa771721ea --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_009.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the component.start operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_009 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.start(f_ptcBehaviour()); + return true; + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_009() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_009()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_010.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf2022f3393a89caa630ce5bf8f7d8649904b685 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_010.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the component.stop operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_010 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.stop; + return true; + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_010() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_010()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_011.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1195adaba66c7b82cb3a8665395060ac37ad7d92 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_011.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the kill operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_011 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.kill; + return true; + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_011() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_011()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_012.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a81615ee4f8f6ee8a88d236f71d264e5a596330 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_012.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the component.running operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_012 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.running) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_012() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_012()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_013.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a63421d17036c1a00ed9041d450420678773b0ea --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_013.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the alive operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.alive) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_013() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_014.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf6f46abd35792272ce53e6a18d0d5b8048a326d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_014.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the done operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_014 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.done; + return true; + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_014() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_014()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_015.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4f757c6e423c714488cfca6606ac5dc90e3044e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_015.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the killed operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_015 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var GeneralComp v_ptc; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.killed; + return true; + } + + altstep a_rcv(boolean p_par := f_test(v_ptc)) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_015() runs on GeneralComp system GeneralComp { + v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_015()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_016.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9fff76bc17091f88b76dc6f0f8848dbc923b3fd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_016.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the port.start operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_016 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.start; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_016() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_016()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_017.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8b50382f2535e4739995affccfbbcce537b82a5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_017.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the port.stop operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.stop; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_013()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_018.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b505dec4150e2d45a2dc980b6429069347f32a62 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_018.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the halt operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_018 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.halt; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_018() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_018()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_019.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fb90746dee6cfe521e4f171d7e558795731b7df --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_019.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the clear operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_019 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.clear; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_019() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_019()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_020.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c216185860886db342c246893a081a5783d9928 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_020.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the checkstate operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (p.checkstate("Started")) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_020() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_020()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_021.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..755febcda09ab82195a4ecfad4710ce0c3aa18df --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_021.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the send operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_021 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.send(2); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_021() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_021()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_022.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bddc4b8607868a434ba70adca3e5167008da595e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_022.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the receive operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_022 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.receive(integer:?); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_022() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_022()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_023.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6ac8c21d9176dea07ea092502651e1381625bd1 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_023.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the trigger operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_023 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.trigger(integer:?); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_023() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_023()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_024.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92c881051003ddc5074e6ff03bcdcb1d499c4a9a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_024.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the call operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_024 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return boolean { + psig.call(S:{}, nowait); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_024() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_024()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_025.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c72ccfb2f8a8af796b0604aaabe1605fb8e7800b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_025.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the getcall operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_025 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.getcall(S:?); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_025() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_025()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_026.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de5dc525eeff21022b407db1c3a2dc17fde66b65 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_026.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the reply operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_026 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.reply(S:{}); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_026() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_026()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_027.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..90ac4aca9fd64bcb82ec906afe476db8c2bb538e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_027.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the getreply operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_027 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return boolean { + psig.getreply(S:?); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_027() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_027()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_028.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8410fd349b414c51905de2bec85e03b06eb5e62b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_028.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the raise operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_028 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.raise(S, "UserException"); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_028() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_028()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_029.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a842bab9bb32dd9ce4fcc969e76d4d11783d907 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_029.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the catch operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_029 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return boolean { + psig.catch(S, charstring:?); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_029() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_029()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_030.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..882ae950b365fb8ca72d47b121cca69bb2317abe --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_030.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the check operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_030 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.check; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_030() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_030()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_031.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35fc25e01862d5cd7d5cb39998f71b11eda49089 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_031.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the connect operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_031 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + connect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_031() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_031()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_032.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..daae1349d27f4dd5724a06e9148ad6fed0541f3b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_032.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the disconnect operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_032 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + disconnect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_032() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_032()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_033.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..77ea460c9bb8ba54f1967e54d72fe13311006e1a --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_033.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the map operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_033 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + map(mtc:p, system:p); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp system GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_033() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_033()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_034.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02732765ae9afaf78a246e2b0fb5022103d5f642 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_034.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the unmap operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_034 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + unmap(mtc:p, system:p); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp system GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_034() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_034()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_035.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ee49b87bd6553d0125ce1262691ad2fd9e6e1ce --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_035.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the action operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_035 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + action("My action"); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_035() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_035()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_036.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6baf910f4171a977acacb5e8fea20e3eaa82261b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_036.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the timer.start operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_036 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.start; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_036() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_036()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_037.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c7ea786df5cfc1a44629e6b0ca37bc8eadda3dc --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_037.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the timer.stop operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_037 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.stop; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_037() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_037()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_038.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f11efd202097e679e03630a44e41b0377148af6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_038.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the timer.running operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_038 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 5.0; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.running) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_038() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_038()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_039.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f55a4a056f3ef02cd08f81e09b71e5b4f28f7c2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_039.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the read operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_039 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.read > 0.0) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_039() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_039()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_040.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee9605fd37f4a3e462642cf3140e245490ea783f --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_040.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the timeout operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_040 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + any timer.timeout; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_040() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_040()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_041.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f55971da0d1a0eb24ca3d710410cca24cbbabcb2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_041.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that a non-deterministic external function call cannot be used in default parameters of altsteps + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_041 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_1602_toplevel_001() return boolean; + + function f_test() runs on GeneralComp return boolean { + if (xf_NegSem_1602_toplevel_001()) { return true; } + else { return true; } + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_041() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_041()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_042.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..89e6af010a6f9d5252bd02c1fc5920702a0acfb7 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_042.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the predefined rnd function cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_042 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (rnd() > 0.5) { return true; } + else { return true; } + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_042() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_042()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_043.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b7315525273de22482598fa8e0abf32111c8aae --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_043.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify a function called in a default parameter of an altstep cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_043 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return boolean { + vc_int := 1; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_043() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_043()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_044.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7005e7370ec1183851bcf71313a1524e4c9d56e --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_044.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify a function called in a default parameter of an altstep cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_044 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_out(vc_int); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_044() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_044()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_045.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ef768e4bb68d798b5704f47ea1e2dac063039cd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_045.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify a function called in a default parameter of an altstep cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_045 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_inout(vc_int); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_045() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_045()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_046.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18228278929100d58e31c6c1d883d11a13187745 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_046.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the setverdict operation cannot be used in default parameter of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_046 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + setverdict(pass); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_046() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_046()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_047.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9b3ea7f90a69bb4dc2132f8c67983b833f5c984 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_047.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the activate operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_047 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + activate(a_anyTimer()); + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_047() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_047()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_048.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56f2ff03d068979e53d19a0ea51120d82ab14e87 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_048.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that the deactivate operation cannot be used in default parameters of altsteps + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_048 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + deactivate; + return true; + } + + altstep a_rcv(boolean p_par := f_test()) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_048() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_048()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_049.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a33d8341ebcf5cfc34071167b204b6f6c314be4b --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_049.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that a function used in a default parameter of an altstep cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_049 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + function f_eval() return integer { + return 10; + } + + function f_test(@fuzzy integer p_par) return boolean { + if (p_par > 0) { + return true; + } else { + return false; + } + } + + altstep a_rcv(boolean p_par := f_test(v_int)) runs on GeneralComp { + [p_par] p.receive(integer:?) {} + } + + testcase TC_NegSem_1602_toplevel_049() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv() {} + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_049()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_050.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97145138461c53dc4f68a0d9d7242cee7a61299c --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_050.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that a external function used in a default parameter of an altstep cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_050 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var @fuzzy integer v_int := f_eval(); + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + external function @deterministic f_test(@fuzzy integer p_par) return boolean; + + altstep a_rcv(@fuzzy boolean p_par := f_test(v_int)) runs on GeneralComp { + [p_par] p.receive(integer:?) {} + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_1602_toplevel_050() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_050()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_051.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ab912e52240dd1c4104a25b973607d3c11d61dd --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_051.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that a function used in a default parameter of an altstep cannot contain fuzzy variables + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_051 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return integer { + var @fuzzy integer v_int := f_eval(); + return v_int; + } + + + altstep a_rcv(integer p_par := f_test()) runs on GeneralComp { + [] p.receive(p_par) {} + } + + function f_eval() return integer { + return 1; + } + + testcase TC_NegSem_1602_toplevel_051() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_051()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_052.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7d39e0be3f13df4d3ec825d81dcbc8182925053 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSem_1602_toplevel_052.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:16.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain the setencode operation + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// Restriction b) +// The evaluation of formal parameters' default values and initialization of local definitions by calling value returning +// functions may have side effects. To avoid side effects that cause an inconsistency between the actual snapshot and the +// state of the component, and to prevent different results of subsequent evaluations on an unchanged snapshot, +// restrictions given in clause 16.1.4 shall apply to the formal parameters' default values and the initialization of local +// definitions. + +module NegSem_1602_toplevel_052 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return integer { + p.setencode(integer, "Binary"); + return 1; + } + + altstep a_rcv(integer p_par) runs on GeneralComp { + [] p.receive(p_par) {} + } + + testcase TC_NegSem_1602_toplevel_052() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_1602_toplevel_052()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSyn_1602_toplevel_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSyn_1602_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c427c4323c56b792f807670fdd60cbf8d3011f4 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/NegSyn_1602_toplevel_001.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass reject + ***************************************************/ +module NegSyn_1602_toplevel_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+1; + } + + + altstep AltSet1() runs on GeneralComp { + + [] messagePort.receive { + setverdict(pass); + } + + var integer v_LocalVar := f_test(); //late definition of a local variable + + } + + testcase TC_NegSyn_1602_toplevel_001 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_NegSyn_1602_toplevel_001()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5aa9a294b457436c308cf2fe90fbe677907a5337 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_001.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.2, Ensure that the IUT recognizes altstep definitions and correctly evaluates them + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1602_toplevel_001 { + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + type component GeneralComp { + port loopbackPort messagePort + } + + function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + + return p_integer+1; + } + + + altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + setverdict(pass); + } + + } + + testcase TC_Sem_1602_toplevel_001 () runs on GeneralComp { + var MessageType v_testMessage; + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + + AltSet1(); + + } + + control{ + + execute(TC_Sem_1602_toplevel_001()); + + } + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a3f56e4c944db30406be827b4760783a0efc0ce --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1, verify that altstep with a runs on clause can be started as component behaviour + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Altsteps started by using the start test component operation shall always have a runs on clause (see clause 22.5) +// and are considered to be invoked in the component to be started, i.e. not locally. However, the start test component +// operation may be invoked within behaviours without a runs on clause. + +module Sem_1602_toplevel_002 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test() runs on GeneralComp{ + [] any port.receive { + setverdict(pass); + } + } + + testcase TC_Sem_1602_toplevel_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + v_ptc.start(a_test()); + v_ptc.done; + } + + control { + execute(TC_Sem_1602_toplevel_002()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a0e8e49807c3a27dc1b3fbb33d5e0e264f5ad54 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1602_altsteps/1602_toplevel/Sem_1602_toplevel_003.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:16.1, verify that altstep with a runs on clause can be started as component behaviour from a context without a runs on clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Restriction f) +// Altsteps started by using the start test component operation shall always have a runs on clause (see clause 22.5) +// and are considered to be invoked in the component to be started, i.e. not locally. However, the start test component +// operation may be invoked within behaviours without a runs on clause. + +module Sem_1602_toplevel_003 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test() runs on GeneralComp{ + [] any port.receive { + setverdict(pass); + } + } + + function f_startPtc(GeneralComp v_ptc) { + v_ptc.start(a_test()); + } + + testcase TC_Sem_1602_toplevel_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, v_ptc:p); + p.send(1); + f_startPtc(v_ptc); + v_ptc.done; + } + + control { + execute(TC_Sem_1602_toplevel_003()); + } +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dd5f60834b646e720f6247021c9fa461be8aeab --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases + ** @verdict pass reject + ***************************************************/ +module NegSem_1603_testcases_001 { + +type component GeneralComp { +} + + +testcase TC_NegSem_1603_testcases_001 () runs on GeneralComp { + execute(TC_fail()); //testcases can only be invoked from the control part + setverdict(pass); +} + +testcase TC_fail () runs on GeneralComp { + setverdict(fail); +} + + +control{ + + execute(TC_NegSem_1603_testcases_001()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c32b2cd0a7027e926bfd23014af54be520b35a79 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/NegSem_1603_testcases_002.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases + ** @verdict pass reject + ***************************************************/ +module NegSem_1603_testcases_002 { + +type component GeneralComp { +} + + +testcase TC_NegSem_1603_testcases_002 () runs on GeneralComp { + TC_fail(); //testcases can only be invoked from the control part + setverdict(pass); +} + +testcase TC_fail () runs on GeneralComp { + setverdict(fail); +} + + +control{ + + execute(TC_NegSem_1603_testcases_002()); + +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4cda719364f4494fc6e7dd749a30321d9effbda --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1603_testcases/Syn_1603_testcases_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:16.3, Ensure that the IUT properly evaluates invocation of testcases with system clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Syn_1603_testcases_001 { + +type component GeneralComp { +} + +testcase TC_Syn_1603_testcases_001 () runs on GeneralComp system GeneralComp { + + setverdict(pass); +} + + +control{ + + execute(TC_Syn_1603_testcases_001()); + +} + +} diff --git a/ATS/core_language/18_overview_program_statements_and_operations/NOTES b/ATS/core_language/18_overview_program_statements_and_operations/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..738791c6994878029ddbf5bb1cf2e90fb5005829 --- /dev/null +++ b/ATS/core_language/18_overview_program_statements_and_operations/NOTES @@ -0,0 +1 @@ +- NOTE: this chapter contains only one table describing where statements are allowed to be used. All these elements were already tested by the other chapters \ No newline at end of file diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_001.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d50e84dc62bc0f5db9d707b4c1a70e1394daafa --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the IUT properly evaluates assignment statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1901_assignments_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_1901_assignments_001 () runs on GeneralComp system GeneralComp { + var integer v_i; + var integer v_j; + + v_j:=v_i; //assignment of unbounded expression + +} + +control{ + + execute(TC_NegSem_1901_assignments_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_002.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59422d2143fee8a10cf409fc610f34d996ac1464 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the IUT properly evaluates assignment statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1901_assignments_002 { + +type component GeneralComp { +} + +testcase TC_NegSem_1901_assignments_002 () runs on GeneralComp system GeneralComp { + var integer v_i; + + v_i:=1.5; //assignment of incompatible expression + +} + +control{ + + execute(TC_NegSem_1901_assignments_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_003.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f911027fbbf8d78c6370b839acd7deb2fe0efd2a --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the IUT properly evaluates assignment statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1901_assignments_003 { + +type component GeneralComp { +} + +testcase TC_NegSem_1901_assignments_003 () runs on GeneralComp system GeneralComp { + var charstring v_i; + + v_i:=pattern "a??b"; //assignment of incompatible expression + +} + +control{ + + execute(TC_NegSem_1901_assignments_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_004.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fcdc0697d90927aefe33eb51ef3af7857498c44 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_004.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that omit assignment to a record non-optional value is not allowed + ** @verdict pass reject + ***************************************************/ + +//Restriction c) +/*If the left-hand side of the assignment is a reference to a non-optional value object (i.e. a value definition, a mandatory field, a record/set of/array element, a union alternative, a value parameter), + * the right-hand side shall not be a reference to an omitted field or the omit symbol.*/ + +module NegSem_1901_assignments_004{ + +type component GeneralComp { +} + + type record Myrec{ + integer field1, + float field2 + }; + +testcase TC_NegSem_1901_assignments_004 () runs on GeneralComp system GeneralComp { + + var Myrec v_i; + + v_i:={11,omit}; //assignment not allowed + + setverdict(pass,v_i); + +} + + +control{ + + execute(TC_NegSem_1901_assignments_004()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_005.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1903a24a2ba5638a8b9d7c4029e4746c30353155 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_005.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that omit assignment to set of non-optional value is not allowed + ** @verdict pass reject + ***************************************************/ + + //Restriction c) +/*If the left-hand side of the assignment is a reference to a non-optional value object (i.e. a value definition, a mandatory field, a record/set of/array element, a union alternative, a value parameter), +the right-hand side shall not be a reference to an omitted field or the omit symbol.*/ + +module NegSem_1901_assignments_005{ + +type component GeneralComp { +} + + type set of integer Myset; + +testcase TC_NegSem_1901_assignments_005 () runs on GeneralComp system GeneralComp { + + var Myset v_i; + + v_i:={11,omit}; //assignment not allowed + + setverdict(pass,v_i); + +} + + +control{ + + execute(TC_NegSem_1901_assignments_005()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_006.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73172abefe5b48e9552642b6a90c94601dba05ad --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSem_1901_assignments_006.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that omit assignment to an array is not allowed + ** @verdict pass reject + ***************************************************/ + +//Restriction c) +/*If the left-hand side of the assignment is a reference to a non-optional value object (i.e. a value definition, a mandatory field, a record/set of/array element, a union alternative, a value parameter), +the right-hand side shall not be a reference to an omitted field or the omit symbol.*/ + +module NegSem_1901_assignments_006{ + +type component GeneralComp { +} + + + +testcase TC_NegSem_1901_assignments_006 () runs on GeneralComp system GeneralComp { + + var integer v_i[2]; + + v_i:={11,omit}; //assignment not allowed + + setverdict(pass,v_i); + +} + + +control{ + + execute(TC_NegSem_1901_assignments_006()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/NegSyn_1901_assignments_001.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSyn_1901_assignments_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b63908f07f41fab1aebf6dc5907c8679627d0c5c --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/NegSyn_1901_assignments_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the IUT properly evaluates assignment statements + ** @verdict pass reject + ***************************************************/ +module NegSyn_1901_assignments_001 { + +type component GeneralComp { +} + +testcase TC_NegSyn_1901_assignments_001 () runs on GeneralComp system GeneralComp { + var integer v_i; + var integer v_j; + var integer v_k; + v_i:=1; + v_k:=(v_j:=v_i); //such sequential assignments are not allowed by the syntax + +} + + +control{ + + execute(TC_NegSyn_1901_assignments_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_001.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd56e2ac85c297a39a0c867fcce248bdf583f5ae --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the IUT properly evaluates assignment statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1901_assignments_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1901_assignments_001 () runs on GeneralComp system GeneralComp { + var integer v_i; + v_i:=3*(2+3*3); //validation of the order of evaluating assignment expressions + + if ( v_i==33 ) { + setverdict(pass); + } + else { + setverdict(fail); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_002.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3eb9d6e3f65ee015ba820c686745e76e5f1667ed --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that uninitialized at the right-hand side of the assignment shall also become uninitialized at the left-hand side + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_1901_assignments_002{ + +type component GeneralComp { +} + + type record Myrec{ + integer field1, + float field2 + }; + +testcase TC_Sem_1901_assignments_002 () runs on GeneralComp system GeneralComp { + var Myrec v_i :={11,1.1}; //fully initialized variable + var Myrec v_j :={12}; //partly initialized variable + + v_i:=v_j; //assignment, v_i is now partly initialized variable + + if (isvalue(v_i)) { + setverdict(fail,v_i); + } + else { + setverdict(pass,v_i); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_003.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3a959d4f5a594f16362f92be3ff305408c3dd60 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that the right-hand side of the assignment of a structured value is evaulted correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_1901_assignments_003{ + +type component GeneralComp { +} + + type record Myrec{ + integer field1, + float field2 + }; + +testcase TC_Sem_1901_assignments_003 () runs on GeneralComp system GeneralComp { + var Myrec v_j :={11,1.1}; //fully initialized variable + var Myrec v_i; + + v_i:=v_j; //assignment + + if (match(v_i,v_j)) { + setverdict(pass,v_i); + } + else { + setverdict(fail,v_i); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_004.ttcn b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dbf11d766f0615dfb466ee6fc2fa3bee05b82413 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1901_assignments/Sem_1901_assignments_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.1, Ensure that Ensure that the right-hand side of the assignment of a structured value is evaulted correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction d) Using a reference to an omitted field in the right-hand side of the assignment has the same effect as using the omit keyword. + +module Sem_1901_assignments_004{ + +type component GeneralComp { +} + + type record Myrec{ + integer field1, + float field2 optional + }; + +type record Myrec_2{ + float field optional + }; + +testcase TC_Sem_1901_assignments_004 () runs on GeneralComp system GeneralComp { + var Myrec v_j :={11,omit}; + var Myrec_2 v_i; + + v_i.field:=v_j.field2; //assignment + + if (match(v_i.field,omit)) { + setverdict(pass,v_i); + } + else { + setverdict(fail,v_i); + } +} + + +control{ + + execute(TC_Sem_1901_assignments_004()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1902_if_else_statement/NegSyn_1902_if_else_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/NegSyn_1902_if_else_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd9d6a5f1dfb6fe1646b97e3811560e53acac391 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/NegSyn_1902_if_else_statement_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.2, If statement requires curly brackets for the body + ** @verdict pass reject + ***************************************************/ +module NegSyn_1902_if_else_statement_001 { + +type component GeneralComp { +} + +testcase TC_NegSyn_1902_if_else_statement_001 () runs on GeneralComp{ + + for(var integer v_i:=1; v_i<10; v_i:= j+1) { + } + + if(v_i==10) + setverdict(pass); // missing { } as defined by grammar rule 175 StatementBlock + +} + + +control{ + + execute(TC_NegSyn_1902_if_else_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f00e976557fb7ff5146e6f65cc541091e1abe987 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.2, Ensure that the IUT properly evaluates if-else statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1902_if_else_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1902_if_else_statement_001 () runs on GeneralComp{ + var integer v_i:=1; + var integer v_j:=2; + + if ( v_i==1 ) { //testing of nested if-else statement + if( v_j==1) { + setverdict(fail); + } + else { + setverdict(pass); + } + } + else { + setverdict(fail); + } +} + + +control{ + + execute(TC_Sem_1902_if_else_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c67d33c5fb140bcd748e9280737cd23cd94889f2 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1902_if_else_statement/Sem_1902_if_else_statement_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.2, Ensure that the IUT properly evaluates if-else statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1902_if_else_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1902_if_else_statement_002 () runs on GeneralComp{ + var integer v_i:=1; + + if ( match(v_i, 2) ) { + setverdict(fail); + } + else if(match(v_i, 1)) { setverdict(pass) }; //else if shorthand notation +} + + +control{ + + execute(TC_Sem_1902_if_else_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..725f8d7093ecdcdd4c8c3cf23af06f50d711ede7 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_001.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:19.3, Verify that two branches of the select-case statement cannot match the same value (simple case) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b: +// When all templateInstances of all branches can be statically evaluated in compile time to specific values or +// value ranges no two branches shall match the same value + +module NegSem_190301_select_case_statement_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_190301_select_case_statement_001 () runs on GeneralComp{ + var integer v_i := 2; + + select (v_i) { + case(1) { + setverdict(fail); + } + case(2) { + setverdict(pass); + } + case(2) { + setverdict(fail); + } + case else { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_NegSem_190301_select_case_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61635606b7c84e575a6ead109e29885ce26c7618 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/NegSem_190301_select_case_statement_002.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:19.3, Verify that two branches of the select-case statement cannot match the same value (list case) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Restriction b: +// When all templateInstances of all branches can be statically evaluated in compile time to specific values or +// value ranges no two branches shall match the same value + +module NegSem_190301_select_case_statement_002 { + +type component GeneralComp { +} + +testcase TC_NegSem_190301_select_case_statement_002 () runs on GeneralComp{ + var integer v_i := 2; + + select (v_i) { + case(1) { + setverdict(fail); + } + case(0, 2) { + setverdict(pass); + } + case(4, 5, 2) { + setverdict(fail); + } + case else { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_NegSem_190301_select_case_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ab3618b7c1fe7737efbac3aca9b04da54d754a8 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_001 () runs on GeneralComp{ + var integer v_i:=2; + + select (v_i) { + case(1) { + setverdict(fail); + } + case(2) { + setverdict(pass); + } + case(3) { + setverdict(fail); + } + case else { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_Sem_190301_select_case_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a386780670330acbb8855a1c4f0911bd559524a7 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_002 () runs on GeneralComp{ + var integer v_i:=5; + + select (v_i) { + case(1) { + setverdict(fail); + } + case(2) { + setverdict(fail); + } + case(3) { + setverdict(fail); + } + case else { + setverdict(pass); + } + } +} + + +control{ + + execute(TC_Sem_190301_select_case_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2e85771ad877f55c1e4c55a3530712a8e1afb08 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_003 () runs on GeneralComp{ + var integer v_i:=5; + + setverdict(pass); + select (v_i) { + case(1) { + setverdict(fail); + } + case(2) { + setverdict(fail); + } + case(3) { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_Sem_190301_select_case_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_004.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2aa582d87f5e057327128c0d070b124f4bc1737 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_004 { + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_004 () runs on GeneralComp{ + var integer v_i:=2; + + select (v_i) { + case(1) { + setverdict(fail); + } + case(2) { + setverdict(pass); + } + case(3) { + setverdict(fail); + } + case else { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_Sem_190301_select_case_statement_004()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_005.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65df49c3676e086f6f06f6d594e1d620b847c4c3 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_005 { + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_005 () runs on GeneralComp{ + var charstring v_i:="aBcDeFg"; + + select (v_i) { + case(charstring:"aBc") { + setverdict(fail); + } + case(charstring:"aBcDeFg") { + setverdict(pass); + } + case(charstring:"aBcD") { + setverdict(fail); + } + case else { + setverdict(fail); + } + } +} + + +control{ + + execute(TC_Sem_190301_select_case_statement_005()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_006.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40d4ceb20f8f1f8b5e6d87beb5590a972fda35ff --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190301_select_case_statement/Sem_190301_select_case_statement_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:19.3, Ensure that the IUT properly evaluates select-case statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_190301_select_case_statement_006 { +modulepar charstring c_par := "aBcDeFg"; + +type component GeneralComp { +} + +testcase TC_Sem_190301_select_case_statement_006 () runs on GeneralComp{ + + select (c_par) { + case(charstring:"aBc") { + setverdict(fail); + } + case(charstring:"aBcDeFg") { + setverdict(pass); + } + case(charstring:"aBcD") { + setverdict(fail); + } + case else { + setverdict(fail); + } +} +} + +control{ + + execute(TC_Sem_190301_select_case_statement_006()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec76c88b01ed80f2cb9b4a0285ea4b747d04a095 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_001.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that header part of select-union statements cannot contain anything else than union instances + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// In the header part of the select union statement a template instance of union +// type shall be given. + +module NegSem_190302_select_union_statement_001 { + + type component GeneralComp { + } + + type record R { + integer intOption optional, + charstring strOption optional, + boolean boolOption optional + } + + testcase TC_NegSem_190302_select_union_statement_001() runs on GeneralComp { + var R v_rec := { intOption := omit, strOption := "abc", boolOption := omit } + select union (v_rec) { + case (intOption) { + setverdict(pass); + } case (strOption) { + setverdict(pass); + } case (boolOption) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_001()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6582dbec273f44b7a63d6c4573ad0e4c395c7fcc --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_002.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that uninitialized value cannot be used in select union header + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// [The TemplateInstance in the header of the select union statement] shall be +// at least partially initialized. + +module NegSem_190302_select_union_statement_002 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + record { + integer field1, + integer field2 + } recOption + } + + type record R { + U field1, + integer field2 + } + + testcase TC_NegSem_190302_select_union_statement_002() runs on GeneralComp { + var R v_rec; + v_rec.field2 := 3; + select union (v_rec.field1) { + case (intOption) { + setverdict(fail); + } case (strOption) { + setverdict(fail); + } case (recOption) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_002()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..577aa246a41490df1d440dc63c188cf38dcaccd8 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that unknown alternatives cannot be use in case statements + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Every Identifier in a case of the select union statement shall be an identifier +// of an alternative of the union type of the template instance given to the +// statement's header. + +module NegSem_190302_select_union_statement_003 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + record { + integer field1, + integer field2 + } recOption + } + + testcase TC_NegSem_190302_select_union_statement_003() runs on GeneralComp { + var U v_un := { intOption := 5 } + select union (v_un) { + case (intOption) { + setverdict(pass); + } case (strOption) { + setverdict(fail); + } case (recOption) { + setverdict(fail); + } case (boolOption) { + setverdict(fail); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_003()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_004.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9aa62befcbdeb07a3c8d4da6b645441cb2ad4a5 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_004.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that the same alternative cannot be used in two case statements (simple case) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// No two cases in a select union statement shall have the same case Identifier. + +module NegSem_190302_select_union_statement_004 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + record { + integer field1, + integer field2 + } recOption + } + + testcase TC_NegSem_190302_select_union_statement_004() runs on GeneralComp { + var U v_un := { recOption := { field1 := 1, field2 := 2 } } + select union (v_un) { + case (intOption) { + setverdict(pass); + } case (strOption) { + setverdict(fail); + } case (recOption) { + setverdict(fail); + } case (intOption) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_004()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_005.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1e742cc12b20ab602774962be2bcac5ec29970b --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that the same alternative cannot be used in two case statements (list item) + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// No two cases in a select union statement shall have the same case Identifier. + +module NegSem_190302_select_union_statement_005 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + record { + integer field1, + integer field2 + } recOption + } + + testcase TC_NegSem_190302_select_union_statement_005() runs on GeneralComp { + var U v_un := { intOption := 10 } + select union (v_un) { + case (intOption, strOption) { + setverdict(pass); + } case (recOption, intOption) { + setverdict(fail); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_005()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_006.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49d83f1bcc1698142c99ad03317200783919524e --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/NegSem_190302_select_union_statement_006.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that it is possible to use a select union statement with several branches + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// c) No two cases in a select union statement shall have the same caseIdentifier or TypeIdentifier. +module NegSem_190302_select_union_statement_006 { + + type component GeneralComp { + } + + testcase TC_NegSem_190302_select_union_statement_006() runs on GeneralComp { + var anytype v_any; + v_any.integer := 2; + v_any.charstring := "abc"; + v_any.float := 1.2; + + select union (v_any) { + case (charstring) { + if(match(v_any.charstring,"abc")) + {setverdict(pass, v_any.charstring);} + } case (integer) { + if(match(v_any.integer,2)) + {setverdict(pass, v_any.integer);} + } case (charstring) { // error + if(match(v_any.charstring,"abc")) + {setverdict(fail, v_any.charstring);} + } + case else { + setverdict(fail); + } + } + } + + control { + execute(TC_NegSem_190302_select_union_statement_006()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7103ede4ae1af315b9b9a2fae2b2bd30d38aa690 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that it is possible to use a select union statement with several branches + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The statement contains a header part and zero or more branches. + +module Sem_190302_select_union_statement_001 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + boolean boolOption + } + + testcase TC_Sem_190302_select_union_statement_001() runs on GeneralComp { + var U v_un := { strOption := "abc" } + select union (v_un) { + case (intOption) { + setverdict(fail); + } case (strOption) { + setverdict(pass); + } case (boolOption) { + setverdict(fail); + } + } + } + + control { + execute(TC_Sem_190302_select_union_statement_001()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33f75c87da345863313ab19a106b0d1baf5f5e42 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that it is possible to use comma separated list of alternatives in case branches + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Each branch shall start with the case keyword followed by one or more identifiers +// of the alternatives (fields) of the union type (a list branch) or the else keyword +// (an else branch) and a statement block. + +module Sem_190302_select_union_statement_002 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + boolean boolOption, + bitstring bitOption + } + + testcase TC_Sem_190302_select_union_statement_002() runs on GeneralComp { + var U v_un := { strOption := "abc" } + select union (v_un) { + case (intOption, boolOption, strOption) { + setverdict(pass); + } case (bitOption) { + setverdict(fail); + } + } + } + + control { + execute(TC_Sem_190302_select_union_statement_002()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d6afd03e908f119d1144839dd09f14de4cbadbe --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that it is possible to use an else branches + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Each branch shall start with the case keyword followed by one or more identifiers +// of the alternatives (fields) of the union type (a list branch) or the else keyword +// (an else branch) and a statement block. + +module Sem_190302_select_union_statement_003 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + boolean boolOption, + bitstring bitOption + } + + testcase TC_Sem_190302_select_union_statement_003() runs on GeneralComp { + var U v_un := { strOption := "abc" } + select union (v_un) { + case (strOption) { + setverdict(pass); + } case (bitOption) { + setverdict(fail); + } case else { + setverdict(fail); + } + } + } + + control { + execute(TC_Sem_190302_select_union_statement_003()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_004.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22de2cd6b602b34d271f5f88e2ba9e515c5b849c --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_004.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that else branch is executed if no case is defined for the selected alternative + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If no case exists for the chosen alternative, the StatementBlock of the else +// branch, if it is present, is executed. + +module Sem_190302_select_union_statement_004 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + boolean boolOption, + bitstring bitOption + } + + testcase TC_Sem_190302_select_union_statement_004() runs on GeneralComp { + var U v_un := { strOption := "abc" } + select union (v_un) { + case (intOption) { + setverdict(fail); + } case (bitOption) { + setverdict(fail); + } case else { + setverdict(pass); + } + } + } + + control { + execute(TC_Sem_190302_select_union_statement_004()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_005.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4933f84613180da31d05a0cebd9438e4e2305df7 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that no branch is executed if the's no suitable case branch + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Otherwise [if no case exists for the chosen alternative and the else branch +// is not present], the select union statement has no effect. + +module Sem_190302_select_union_statement_005 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + boolean boolOption, + bitstring bitOption + } + + testcase TC_Sem_190302_select_union_statement_005() runs on GeneralComp { + var U v_un := { strOption := "abc" } + select union (v_un) { + case (intOption) { + setverdict(pass); + } case (bitOption) { + setverdict(fail); + } + } + setverdict(pass); + } + + control { + execute(TC_Sem_190302_select_union_statement_005()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_006.ttcn b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e37f4475abdaf803aafc01a9e7cba4b2725a090 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1903_select_statements/190302_select_union_statement/Sem_190302_select_union_statement_006.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.3.2, verify that partially initialized value can be used in select union header + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// [The TemplateInstance in the header of the select union statement] shall be +// at least partially initialized. + +module Sem_190302_select_union_statement_006 { + + type component GeneralComp { + } + + type union U { + integer intOption, + charstring strOption, + record { + integer field1, + integer field2 + } recOption + } + + testcase TC_Sem_190302_select_union_statement_006() runs on GeneralComp { + var U v_un := { recOption := { field1 := 1, field2 := - } } + select union (v_un) { + case (intOption) { + setverdict(fail); + } case (strOption) { + setverdict(fail); + } case (recOption) { + setverdict(pass); + } + } + } + + control { + execute(TC_Sem_190302_select_union_statement_006()); + } +} diff --git a/ATS/core_language/19_basic_program_statements/1904_for_statement/NegSem_1904_for_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1904_for_statement/NegSem_1904_for_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0cdd52a32b476da2059dcaaeb610d36d2be0954a --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1904_for_statement/NegSem_1904_for_statement_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.4, Ensure that the IUT properly evaluates for statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1904_for_statement_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_1904_for_statement_001 () runs on GeneralComp{ + + for(var integer v_i:=1; v_i<10; v_i:= j+1) { + } + + if(v_i==10) { setverdict(pass); } //v_i is not accessible from outside the loop + +} + + +control{ + + execute(TC_NegSem_1904_for_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e66f13864223f6c24221aea30661abb80218e72 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.4, Ensure that the IUT properly evaluates for statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1904_for_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1904_for_statement_001 () runs on GeneralComp{ + var integer v_i; + var integer v_j:=1; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + v_j:=v_j+1; + } + + if( match(v_i, 10) and match(v_j, 10) ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1904_for_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..af521b4305d7eefd1b355415c46586852d49f523 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.4, Ensure that the IUT properly evaluates for statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1904_for_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1904_for_statement_002 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + if(v_i==5) { break; } + } + + if(v_i==5) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1904_for_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f46466ef1e440fd42edccddaa3b077c572fdf923 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1904_for_statement/Sem_1904_for_statement_003.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.4, Ensure that the IUT properly evaluates for statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1904_for_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_1904_for_statement_003 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + for(var integer v_j:=1; v_j<10; v_j:= v_j+1) { + if(v_i==5) { break; } //the break statement must only exit the inner loop + } + } + + if(v_i==10) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1904_for_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1905_while_statement/NegSem_1905_while_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1905_while_statement/NegSem_1905_while_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3f1b2e0a008be2a6bed9b8f7aad103cf14f607f --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1905_while_statement/NegSem_1905_while_statement_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.5, Ensure that the IUT properly evaluates while statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1905_while_statement_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_1905_while_statement_001 () runs on GeneralComp{ + var integer v_i:=1; + + while(v_i<10) { + var integer v_j:=1; + v_i:=v_i+1; + } + + if(v_j==1) { setverdict(pass); } //v_j is not accessible from outside the loop + +} + + +control{ + + execute(TC_NegSem_1905_while_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ded053ef58f35fd7ae9d943f5697ebeff7795987 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.5, Ensure that the IUT properly evaluates while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1905_while_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1905_while_statement_001 () runs on GeneralComp{ + var integer v_j:=1; + + while(v_j<10) { + v_j:=v_j+1; + } + + if( v_j==10 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1905_while_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a9dff99614fd3853654d50972773de67c63f879 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.5, Ensure that the IUT properly evaluates while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1905_while_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1905_while_statement_002 () runs on GeneralComp{ + var integer v_i:=1; + + while(v_i<10) { + if(v_i==5) { break; } + v_i:=v_i+1; + } + + if(v_i==5) { setverdict(pass); } + else { setverdict(fail); } + +} + + +control{ + + execute(TC_Sem_1905_while_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca045a511a1f7eebef6af02182991b92c9ada10a --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1905_while_statement/Sem_1905_while_statement_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.5, Ensure that the IUT properly evaluates while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1905_while_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_1905_while_statement_003 () runs on GeneralComp{ + var integer v_i:=1; + var integer v_j:=1; + + while(v_i<10) { + while(v_j<10) { + if(v_i==5) { break; } + v_j:=v_j+1; + } + v_i:=v_i+1; + } + + if(v_i==10) { setverdict(pass); } + else { setverdict(fail); } + +} + + +control{ + + execute(TC_Sem_1905_while_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1906_do_while_statement/NegSem_1906_do_while_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/NegSem_1906_do_while_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56365d59b6528e7f8e880245239600ffdce80be5 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/NegSem_1906_do_while_statement_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.6, Ensure that the IUT properly evaluates do-while statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1906_do_while_statement_001 { + +type component GeneralComp { +} + +testcase TC_NegSem_1906_do_while_statement_001 () runs on GeneralComp{ + var integer v_i:=1; + + do { + var integer v_j:=1; + v_i:=v_i+1; + } while(v_i<10); + + if(v_j==1) { setverdict(pass); } //v_j is not accessible from outside the loop + +} + + +control{ + + execute(TC_NegSem_1906_do_while_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5ac7d84748e576a8eef2e076d68891f96d9cc8c --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.6, Ensure that the IUT properly evaluates do-while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1906_do_while_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1906_do_while_statement_001 () runs on GeneralComp{ + var integer v_j:=1; + + do { + v_j:=v_j+1; + } while(v_j<10); + + if( v_j==10 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1906_do_while_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b15a07ae34129e98ac0fee91938d97e94a7dcbd --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_002.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.6, Ensure that the IUT properly evaluates do-while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1906_do_while_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1906_do_while_statement_002 () runs on GeneralComp{ + var integer v_i:=1; + + do { + if(v_i==5) { break; } + v_i:=v_i+1; + } while(v_i<10); + + if(v_i==5) { setverdict(pass); } + else { setverdict(fail); } + +} + + +control{ + + execute(TC_Sem_1906_do_while_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..126a1b7b81e8ca169c3a0152ab12e066b721d27a --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1906_do_while_statement/Sem_1906_do_while_statement_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.6, Ensure that the IUT properly evaluates do-while statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1906_do_while_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_1906_do_while_statement_003 () runs on GeneralComp{ + var integer v_i:=1; + var integer v_j:=1; + + do { + do { + if(v_i==5) { break; } + v_j:=v_j+1; + } while(v_j<10); + v_i:=v_i+1; + } while(v_i<10); + + if(v_i==10) { setverdict(pass); } + else { setverdict(fail); } + +} + + +control{ + + execute(TC_Sem_1906_do_while_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSem_1907_label_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSem_1907_label_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ce8d5ff9dcf8efed6d468af9611d6046d9105f9 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSem_1907_label_statement_001.ttcn @@ -0,0 +1,71 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.7, Ensure that the IUT correctly handles label naming uniqueness. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1907_label_statement_001 { + + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + label L1; + return p_integer+1; +} + + +altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + label L_A; + setverdict(pass); + label L_B; + } + +} + +testcase TC_NegSem_1907_label_statement_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + label L1; + + alt { + [] AltSet1(); + [] messagePort.receive { + label L2; + setverdict(pass); + } + [] t_timer.timeout { + label L3; + } + } + label L1; //conflicting label names +} + +control{ + execute(TC_NegSem_1907_label_statement_001()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42a95611356c6a7d41d5e3216eddc081489954b2 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_001.ttcn @@ -0,0 +1,72 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.7, Ensure that the IUT correctly handles label syntax. + ** @verdict pass reject + *****************************************************************/ + +module NegSyn_1907_label_statement_001 { + + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + label L1; + return p_integer+1; +} + + +altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + label L_A; + setverdict(pass); + label L_B; + } + +} + +testcase TC_NegSyn_1907_label_statement_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + label L1; + + alt { + [] AltSet1(); + label L_wrong; //wrong label on the alt toplevel + [] messagePort.receive { + label L2; + setverdict(pass); + } + [] t_timer.timeout { + label L3; + } + } + label L4; +} + +control{ + execute(TC_NegSyn_1907_label_statement_001()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa0997c0a5cf28fdae66ad6647ad04d91457f0e1 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1907_label_statement/NegSyn_1907_label_statement_002.ttcn @@ -0,0 +1,73 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.7, Ensure that the IUT correctly handles label syntax. + ** @verdict pass reject + *****************************************************************/ + +module NegSyn_1907_label_statement_002 { + + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + label L1; + return p_integer+1; +} + + +altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + label L_wrong; //wrong label on the altstep toplevel + + [] messagePort.receive { + label L_A; + setverdict(pass); + label L_B; + } + +} + +testcase TC_NegSyn_1907_label_statement_002 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + label L1; + + alt { + [] AltSet1(); + [] messagePort.receive { + label L2; + setverdict(pass); + } + [] t_timer.timeout { + label L3; + } + } + label L4; +} + +control{ + execute(TC_NegSyn_1907_label_statement_002()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1907_label_statement/Syn_1907_label_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1907_label_statement/Syn_1907_label_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac77ac9de798360a72a39e8d2cfd19b43148d3c2 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1907_label_statement/Syn_1907_label_statement_001.ttcn @@ -0,0 +1,71 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.7, Ensure that the IUT correctly handles label syntax. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_1907_label_statement_001 { + + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + label L1; + return p_integer+1; +} + + +altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + label L_A; + setverdict(pass); + label L_B; + } + +} + +testcase TC_Syn_1907_label_statement_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + label L1; + + alt { + [] AltSet1(); + [] messagePort.receive { + label L2; + setverdict(pass); + } + [] t_timer.timeout { + label L3; + } + } + label L4; +} + +control{ + execute(TC_Syn_1907_label_statement_001()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3a2f725be475e946d390fc92cd6d6eddcafcefd --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_001.ttcn @@ -0,0 +1,73 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_1908_goto_statement_001 { + + + type record MessageType { + integer field1, + charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +function f_test ( integer p_integer := 0 ) runs on GeneralComp return integer { + label L1; + return p_integer+1; +} + + +altstep AltSet1() runs on GeneralComp { + var integer v_LocalVar := f_test(); // local variable + + [] messagePort.receive { + label L_A; + label L_B; + } + +} + +testcase TC_NegSem_1908_goto_statement_001 () runs on GeneralComp { + var MessageType v_testMessage; + timer t_timer; + + v_testMessage:= { + field1 := 1, + field2 := "test string" + } + + messagePort.send(v_testMessage); + t_timer.start( 1.0 ); + label L1; + goto L2; //cannot jump into alt statements + + alt { + [] AltSet1(); + [] messagePort.receive { + label L2; + setverdict(pass); + } + [] t_timer.timeout { + label L2; + } + } + label L3; + setverdict(pass); + +} + +control{ + execute(TC_NegSem_1908_goto_statement_001()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d44bda80ed2667f23327156afeb63df1e62d048 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_002.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass reject + *****************************************************************/ +module NegSem_1908_goto_statement_002 { + +type component GeneralComp { +} + +testcase TC_NegSem_1908_goto_statement_002 () runs on GeneralComp{ + var integer v_i; + goto L1; //forbidden jump into a loop + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + label L1; + if(v_i==5) { break; } + } + +} + + +control{ + + execute(TC_NegSem_1908_goto_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccdbfe26fe5011fb09e38d42aa67abdeceddd404 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/NegSem_1908_goto_statement_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass reject + *****************************************************************/ +module NegSem_1908_goto_statement_003 { + +type component GeneralComp { +} + +testcase TC_NegSem_1908_goto_statement_003 () runs on GeneralComp{ + var integer v_i:=1; + goto L1; //forbidden jump into a loop + + if(v_i==2) { + label L1; + v_i:=1; + } + else { + v_i:=2; + goto L1; //forbidden jump into an if-else statement + } + +} + +control{ + + execute(TC_NegSem_1908_goto_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f2dde0c90b85afd5cff2ef5e3bd30716a3a0afd --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1908_goto_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1908_goto_statement_001 () runs on GeneralComp{ + var integer v_i:=1; + goto L1; //jumping forward + v_i:=2; + + label L1; + + if( v_i==1 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1908_goto_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc696a8be69f52a2cf082cc94887659f84fda515 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1908_goto_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1908_goto_statement_002 () runs on GeneralComp{ + var integer v_i:=1; + + label L1; + v_i:=v_i+1; + + if(v_i==2) { goto L1; } //jumping backward + + if( v_i==3 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1908_goto_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60ff7c91fceb6e50f2d40e9238918d18088059b7 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1908_goto_statement/Sem_1908_goto_statement_003.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.8, Ensure that the IUT correctly handles goto statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1908_goto_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_1908_goto_statement_003 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + if(v_i==5) { goto L1; } //jumping out of the loop + } + + label L1; + + if( v_i==5 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1908_goto_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e01a48e2623fce10d50b7613e08a8c91dcd12380 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.9, Ensure that the IUT correctly handles stop statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1909_stop_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1909_stop_statement_001 () runs on GeneralComp{ + setverdict(pass); + stop; + setverdict(fail); + +} + + +control{ + + execute(TC_Sem_1909_stop_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..208756c00cd45efaf1fdf450b1a607fd3602db1f --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_002.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.9, Ensure that the IUT correctly handles stop statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1909_stop_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1909_stop_statement_002 () runs on GeneralComp{ + setverdict(pass); +} + +testcase TC_not_to_be_executed () runs on GeneralComp{ + setverdict(fail); +} + + +control{ + execute(TC_Sem_1909_stop_statement_002()); + stop; + execute(TC_not_to_be_executed()); +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..710f85ddf65e4887fc8e5d8b45264101ae3d8bce --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.9, stop statement in a function called from a PTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// When invoked in a test case, altstep or function that are executed on a test +// component, it terminates the relevant test component. + +module Sem_1909_stop_statement_003 { + + type component GeneralComp { + } + + function f_stop() runs on GeneralComp { + setverdict(pass); + stop; + } + + function f_ptc() runs on GeneralComp { + f_stop(); + setverdict(fail); + } + + testcase TC_Sem_1909_stop_statement_003 () runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptc()); + v_ptc.done; + } + + + control { + execute(TC_Sem_1909_stop_statement_003()); + } + +} diff --git a/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_004.ttcn b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1946e5d87c018f794c0187caef3b276e822efadf --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1909_stop_statement/Sem_1909_stop_statement_004.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:19.9, stop statement in a function called from a PTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// When invoked in a test case, altstep or function that are executed on a test +// component, it terminates the relevant test component. + +module Sem_1909_stop_statement_004 { + + type component GeneralComp { + } + + testcase TC_Sem_1909_stop_statement_004 () runs on GeneralComp { + setverdict(pass); + } + + testcase TC_not_to_be_executed () runs on GeneralComp{ + setverdict(fail); + } + + function f_stop() { + execute(TC_Sem_1909_stop_statement_004()); + stop; + } + + control { + f_stop(); + execute(TC_not_to_be_executed()); + } + +} diff --git a/ATS/core_language/19_basic_program_statements/1910_return_statement/NOTES b/ATS/core_language/19_basic_program_statements/1910_return_statement/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..55cb17da1d417f8ec203de496fee4e1ab68f7671 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1910_return_statement/NOTES @@ -0,0 +1,2 @@ +The functionality of the RETURN statement has been extensively tested in other sections. +This section contains only special cases which have not been tested elsewhere. \ No newline at end of file diff --git a/ATS/core_language/19_basic_program_statements/1910_return_statement/NegSem_1910_return_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1910_return_statement/NegSem_1910_return_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0da4056b20b8e61291195edfb750dc6c567edee3 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1910_return_statement/NegSem_1910_return_statement_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.10, Ensure that the IUT correctly handles return statements. + ** @verdict pass reject + *****************************************************************/ +module NegSem_1910_return_statement_001 { + + type component GeneralComp { + } + + + testcase TC_NegSem_1910_return_statement_001 () runs on GeneralComp{ + setverdict(pass); + return 0; //testcase cannot have a return statement + + } + + + control{ + + execute(TC_NegSem_1910_return_statement_001()); + + } + +} diff --git a/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d54ea9cbbc34270340cbf3e2db35a6bfafb16669 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:19.10, Ensure that the IUT correctly handles return statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1910_return_statement_001 { + + type component GeneralComp { + } + + function f_verdict_return() runs on GeneralComp return verdicttype { + setverdict(pass); + return getverdict; + } + + + testcase TC_Sem_1910_return_statement_001 () runs on GeneralComp { + if (f_verdict_return() != pass) { + setverdict(fail, "function return value wrong"); + } + if (getverdict != pass) { + setverdict(fail, "component verdict not set"); + } + + } + + + control{ + + execute(TC_Sem_1910_return_statement_001()); + + } + +} diff --git a/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cd7225228f98a0b80fcf458b4ad555769036336 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1910_return_statement/Sem_1910_return_statement_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:19.10, Ensure that the IUT correctly handles return statements. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_1910_return_statement_002 { + + type component GeneralComp { + } + + function f_template_return() return template charstring { + setverdict(pass); + return ?; + } + + + testcase TC_Sem_1910_return_statement_002 () runs on GeneralComp { + if ( match("A",f_template_return() ) ) { + setverdict(pass, "function return value correct"); + } + else { + setverdict(fail, "function return value wrong"); + } + + } + + + control{ + + execute(TC_Sem_1910_return_statement_002()); + + } + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/NegSem_1911_log_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/NegSem_1911_log_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0469fd758f0a1e66a9d305a2a78c34c4020b23db --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/NegSem_1911_log_statement_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass reject + ***************************************************/ +module NegSem_1911_log_statement_001 { + +type component GeneralComp { +} + +function f_no_return(integer p_arg) { + var integer v_f; + v_f:=p_arg; +} + +testcase TC_NegSem_1911_log_statement_001 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + log("Function without return value: ", f_no_return(v_i) ); //not allowed to use function without return value + } + +} + + +control{ + + execute(TC_NegSem_1911_log_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..287c524c4d0d64a137d052cc017afed4fa2c1585 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1911_log_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1911_log_statement_001 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + log("Actual value of v_i: ", v_i); //actual value of v_i is expected, log output is not validated by the script + } + + setverdict(pass) + +} + + +control{ + + execute(TC_Sem_1911_log_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_002.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f9711d3561de2009e4e7267d676eb4a6a68e36f --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1911_log_statement_002 { + +type component GeneralComp { +} + +testcase TC_Sem_1911_log_statement_002 () runs on GeneralComp{ + var integer v_i; + + log("Actual value of v_i: ", v_i); //expected to print "UNINITIALIZED" for the unbounded v_i value, log output is not validated by the script + + setverdict(pass) + +} + + +control{ + + execute(TC_Sem_1911_log_statement_002()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_003.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b6a25f688a2120c045e655f8e7686e06d22380e --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_003.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1911_log_statement_003 { + +type component GeneralComp { +} + +testcase TC_Sem_1911_log_statement_003 () runs on GeneralComp{ + const integer c_i:=1; + + log("Actual value of c_i: ", c_i); //expected to print 1 for c_i constant value, log output is not validated by the script + + setverdict(pass) + +} + + +control{ + + execute(TC_Sem_1911_log_statement_003()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_004.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57dea5672e61abeb4e6691ccffcfdf5d794815f8 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_004.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1911_log_statement_004 { + +type component GeneralComp { +} + +function f_square(integer p_arg) return integer { + return p_arg*p_arg; +} + +testcase TC_Sem_1911_log_statement_004 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + log("Actual value of v_i squared: ", f_square(v_i) ); //actual value of v_i squared is expected, log output is not validated by the script + } + + setverdict(pass) + +} + + +control{ + + execute(TC_Sem_1911_log_statement_004()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_005.ttcn b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..739abbefcd2221ed4b5224b9b939d0262a020561 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1911_log_statement/Sem_1911_log_statement_005.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.11, Ensure that the IUT properly evaluates log statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1911_log_statement_005 { + +type component GeneralComp { +} + +testcase TC_Sem_1911_log_statement_005 () runs on GeneralComp{ + var integer v_i; + timer t_1; + + t_1.start(1.0); + log("Actual timer state: ", t_1); //running state is expected, log output is not validated by the script + log("Is timer running? ", t_1.running); //true is expected, log output is not validated by the script + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + log("Actual timer value: ", t_1.read); //actual timer value is expected, log output is not validated by the script + } + + t_1.stop; + log("Actual timer state: ", t_1); //stopped state is expected, log output is not validated by the script + log("Is timer running? ", t_1.running); //false is expected, log output is not validated by the script + + setverdict(pass) + +} + + +control{ + + execute(TC_Sem_1911_log_statement_005()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1912_break_statement/NOTES b/ATS/core_language/19_basic_program_statements/1912_break_statement/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..e32353af89240bafc3a62a5b37b95b0d1e0f426d --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1912_break_statement/NOTES @@ -0,0 +1,2 @@ +The functionality of the BREAK statement has been exhaustively tested in the preceding sections. +No further testing is required for this statement. \ No newline at end of file diff --git a/ATS/core_language/19_basic_program_statements/1913_continue_statement/Sem_1913_continue_statement_001.ttcn b/ATS/core_language/19_basic_program_statements/1913_continue_statement/Sem_1913_continue_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51d5a6180f2b2a9c3a6d48331e433e874b3649c1 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1913_continue_statement/Sem_1913_continue_statement_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:19.13, Ensure that the IUT properly evaluates continue statements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_1913_continue_statement_001 { + +type component GeneralComp { +} + +testcase TC_Sem_1913_continue_statement_001 () runs on GeneralComp{ + var integer v_i; + + for(v_i:=1; v_i<10; v_i:= v_i+1) { + if(v_i==5) { continue; } + if(v_i==5) { break; } + } + + if( v_i==10 ) { setverdict(pass); } + else { setverdict(fail); } + + +} + + +control{ + + execute(TC_Sem_1913_continue_statement_001()); + +} + +} diff --git a/ATS/core_language/19_basic_program_statements/1914_statement_block/NOTES b/ATS/core_language/19_basic_program_statements/1914_statement_block/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..5469318eb2f44da1ca5eb1ac38285b02502f2956 --- /dev/null +++ b/ATS/core_language/19_basic_program_statements/1914_statement_block/NOTES @@ -0,0 +1,2 @@ +The functionality of the statement blocks ( {...} ) has been exhaustively tested in the preceding sections. +No further testing is required in this section. \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2001_the_snapshot_mechanism/NOTES b/ATS/core_language/20_statement_and_operations_for_alt/2001_the_snapshot_mechanism/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..f6f92612249dad84cd30ba6370664dccbc0215fc --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2001_the_snapshot_mechanism/NOTES @@ -0,0 +1,2 @@ +- NOTE: currently untested. if this can be tested at all from within TTCN-3, we'll have to refer to + part 4 for details at this point as the description in 20.1 is pretty basic. \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NOTES b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..66349743f22774b339e4cde614dbfd3ba3125bf9 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NOTES @@ -0,0 +1,3 @@ +NOTES: +1. Side effects (restrictions b, c, d) related to function calls are tested in 16.1.4 +2. Side effects (restrictions b, c, d) related to direct calls of operations listed in 16.1.4 (such as create, running, alive etc.) are tested in this section diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c933f5e68722eefad480a2f2f1133840df063026 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_001.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.2, dynamic error if a test component is completely blocked + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// The test case shall stop and indicate a dynamic error if a test component is +// completely blocked. This means none of the alternatives can be chosen, no +// relevant test component is running, no relevant timer is running and all +// relevant ports contain at least one message, call, reply or exception that +// do not match. + +module NegSem_2002_TheAltStatement_001 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_001() runs on GeneralComp { + timer t_tmr1; + p.send(m_test); + alt { + [] p.receive("abc") { + setverdict(pass); + } + [] t_tmr1.timeout { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cf1ae4a59a43abfd2737ec6bb1b4b34e141eb10 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_002 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_002() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(m_test); + alt { + [GeneralComp.create != null] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98155344b90c967be31eb41a998e1e6995ff472e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_003.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_003 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_003() runs on GeneralComp { + timer t_tmr := 1.0; + t_tmr.start; + p.send(m_test); + alt { + [t_tmr.running] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac892d132cf18aa05d1aa12c64d189afddc5b808 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_004 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_004() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(m_test); + alt { + [mtc.running] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc0d355133cdf6c59561302096710d241a24fb6f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_005.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_005 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_005() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(m_test); + alt { + [mtc.alive] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..effa1354bd4f55d7a67a4617fefb7098a5be059a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_006.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_006 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + altstep a_timeout() { + [] any timer.timeout { + } + } + + testcase TC_NegSem_2002_TheAltStatement_006() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(m_test); + alt { + [activate(a_timeout()) != null] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_007.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41c608e24a820b87f172b934ab1c23d68977e649 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_007.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in alt branch events (in inline template) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_007 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_007() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(boolean:GeneralComp.create != null) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_008.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0edf5025a2db9f54b69734ffb7e4975e2a2f27a0 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_008.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_008 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_008() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(boolean:t_tmr.running) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_009.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68e92de2e5c4712906e1b0f58c11ea58752f2023 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_009.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_009 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_009() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(boolean:mtc.running) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_010.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..561ce948413fdd632f6316f870e719a13ffbffd2 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_010.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_010 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_010() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(boolean:mtc.alive) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_011.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14ae0d8176b4eb34868287476159458e0ea2fcf1 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_011.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_011 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_timeout() { + [] any timer.timeout { + } + } + + testcase TC_NegSem_2002_TheAltStatement_011() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(boolean:activate(a_timeout()) != null) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_012.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c345941cfb4d2d126af2c349b1a3c661567ee28 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_012.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_012 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_012() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_receive(GeneralComp.create != null); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_013.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f37caf303034ce9696a377d73932e812c31b556f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_013.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_013 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] a_receive(t_tmr.running); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_014.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92007f7e813456190ff4fdc4423c74487170548d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_014.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_014 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_014() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_receive(mtc.running); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_015.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f978f7df59bca0b7c0cfb242de3e8895b4995492 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_015.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_015 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_015() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_receive(mtc.alive); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_015()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_016.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2711ef90f3b5b0527519fff28299c8528d3aa974 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_016.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_016 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + altstep a_timeout() { + [] any timer.timeout { + } + } + + testcase TC_NegSem_2002_TheAltStatement_016() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_receive(activate(a_timeout()) != null); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_016()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_017.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8fb1042ff545efa492fb45ebcc5d1b7eace13674 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_017.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the create operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_017 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return boolean { + var GeneralComp v_ptc := GeneralComp.create; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_017() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_017()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_018.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c3ffb6e013bd443acd2f8893fbbc30964745885e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_018.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the component.start operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_018 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + log("PTC running"); + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.start(f_ptcBehaviour()); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_018() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_018()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_019.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee2c9d683abc273bee1ef408544f2308d8064717 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_019.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the component.stop operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_019 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.stop; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_019() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_019()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_020.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8e3ddc8a6b97b261813f8da443669816df2215e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_020.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the kill operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.kill; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_020() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_020()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_021.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d481abca40bb0cb59c617d71a18585f843603318 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_021.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_021 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.running) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_021() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_021()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_022.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be051bc50664f17e691a72b7039d7d2a7873285a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_022.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the alive operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_022 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_test(GeneralComp p_ptc) return boolean { + if (p_ptc.alive) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_022() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_022()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_023.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4681b049737f14719ac2d49e7d57bbd4ec24d747 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_023.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the done operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_023 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.done; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_023() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_023()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_024.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9beee45620b884280cc0565d22a33f9910c4a677 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_024.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the killed operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_024 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + function f_test(GeneralComp p_ptc) return boolean { + p_ptc.killed; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_024() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f_ptcBehaviour()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_ptc)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_024()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_025.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b2320e122db794635690c60e65a17f55be1228d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_025.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the port.start operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_025 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.start; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_025() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_025()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_026.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c02f3f8211d60351ac86f5c4f3e659b4c108fa6e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_026.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the port.stop operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_013 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.stop; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_013() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_013()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_027.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65efff9a4b9eaa12f9b51b4edaaa9bc4b3a26b68 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_027.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the halt operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_027 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.halt; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_027() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_027()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_028.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57f8e19ba4465f3011261c2eb12fd6f902c6f384 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_028.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the clear operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_028 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.clear; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_028() runs on GeneralComp system GeneralComp { + timer t_tmr := 0.1; + t_tmr.start; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_028()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_029.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f480d73b7742809e293b30ba0a38201ec4743b1f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_029.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_029 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (p.checkstate("Started")) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_029() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_029()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_030.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5834f587dc81b7ddae6cab6216d69439664d7356 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_030.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the send operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_030 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.send(2); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_030() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_030()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_031.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b9e8c617c812206d8b434486b89fff7d0225148 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_031.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the receive operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_031 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.receive(integer:?); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_031() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_031()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_032.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a367e624367463192d949d47caed94d1a17b1a97 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_032.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the trigger operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_032 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.trigger(integer:?); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_032() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_032()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_033.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b17e17834c28837526f1e285c185486179a2c0d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_033.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the call operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_033 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_test() runs on GeneralComp return boolean { + psig.call(S:{}, nowait); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_033() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_033()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_034.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8555916969b6a954592aae1b93d94cada862388f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_034.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the getcall operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_034 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.getcall(S:?); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_034() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_034()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_035.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7bf5f7cb9a523fd712f618a14d0c94455c705d01 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_035.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the reply operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_035 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.reply(S:{}); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_035() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_035()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_036.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3270b557fc8098e99cceca34bb452c946cd5ab43 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_036.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the getreply operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_036 { + type port P message { + inout integer; + } + + signature S(); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.reply(S:{}); + } + + function f_test() runs on GeneralComp return boolean { + psig.getreply(S:?); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_036() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_036()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_037.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e94d2a89ff2aca81bd9cc842c2dfb805eab473a4 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_037.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the raise operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_037 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.call(S:{}, nowait); + } + + function f_test() runs on GeneralComp return boolean { + psig.raise(S, "UserException"); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_037() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + p.send(1); + psig.getcall(S:?); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_037()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_038.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44a9a6e62fe8bb98eb1211fcf2f01203259f2818 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_038.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the catch operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_038 { + type port P message { + inout integer; + } + + signature S() exception (charstring); + + type port PSig procedure { + inout S; + } + + type component GeneralComp { + port P p; + port PSig psig; + } + + function f_ptcBehaviour() runs on GeneralComp { + psig.getcall(S:?); + psig.raise(S, "UserException"); + } + + function f_test() runs on GeneralComp return boolean { + psig.catch(S, charstring:?); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_038() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(mtc:p, mtc:p); + connect(mtc:psig, v_ptc:psig); + v_ptc.start(f_ptcBehaviour()); + psig.call(S:{}, nowait); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_038()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_039.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c5118bc162364c263c494f0688824ce981289a5 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_039.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the check operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_039 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + p.check; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_039() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_039()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_040.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bf5c64aaef3f438aa4464b63a399a81f4784710 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_040.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the connect operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_040 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + connect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_040() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_040()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_041.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3945e062fed395e16da866c2924b07928fa25f8e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_041.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the disconnect operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_041 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + disconnect(mtc:p, mtc:p); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_041() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_041()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_042.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..89124e7e4ec906b507036e3cbf981702b856cc33 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_042.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the map operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_042 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + map(mtc:p, system:p); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp system GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_042() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_042()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_043.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4449a6512a62862de78aee9c50137d9c02a6c0f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_043.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the unmap operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_043 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp system GeneralComp return boolean { + unmap(mtc:p, system:p); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp system GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_043() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + disconnect(mtc:p, mtc:p); + map(mtc:p, system:p); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_043()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_044.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfab94f782bfbaf0d3cbdbb4b7a3eca383c9d2e5 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_044.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the action operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_044 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + action("My action"); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_044() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_044()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_045.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e438d45e624e81421ec9daacb9f4149a5e7088d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_045.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the timer.start operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_045 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.start; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_045() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_045()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_046.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43b4635bcf1f3d5863a355a03ea1662a88a941c4 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_046.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the timer.stop operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_046 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + tc_tmr.stop; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_046() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_046()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_047.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78bcb4ddb595726e9783599b4fbcda619ca07fb2 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_047.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_047 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 5.0; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.running) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_047() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_047()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_048.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fcc26090a298325833c3f173f4c52be6761578f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_048.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_048 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + if (tc_tmr.read > 0.0) { return true; } + else { return false; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_048() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_048()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_049.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3419b9beb76213929fe1ce9f584521340442b2d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_049.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the timeout operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_049 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + timer tc_tmr := 0.1; + } + + function f_test() runs on GeneralComp return boolean { + any timer.timeout; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_049() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + tc_tmr.start; + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_049()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_050.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2bc6ff6946cbce8c40ba73bee0c6cd66bee36e35 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_050.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a non-deterministic external function call cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ** @configuration external_functions + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_050 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + /** + * @return always true + */ + external function xf_NegSem_2002_TheAltStatement_001() return boolean; + + function f_test() runs on GeneralComp return boolean { + if (xf_NegSem_2002_TheAltStatement_001()) { return true; } + else { return true; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_050() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_050()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_051.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c4ad1b1d3b300d57ece0729526e642177afa1b9 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_051.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the predefined rnd function cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_051 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + if (rnd() > 0.5) { return true; } + else { return true; } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_051() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_051()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_052.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..802b3ec89c34f69dfafffca99d3f2aa3bf40acdc --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_052.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify a function called in a guard of an altstep cannot contain an assignment of a component variable + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_052 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_test() runs on GeneralComp return boolean { + vc_int := 1; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_052() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_052()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_053.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51c0897128fbfea170072ea7f2ca79192e6472b5 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_053.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify a function called in a guard of an altstep cannot contain a component variable used as an actual out parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_053 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int; + } + + function f_out (out integer p_out) { + p_out := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_out(vc_int); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_053() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_053()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_054.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b49b95d066cf50812bb010116ded05cbd2c1490 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_054.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify a function called in a guard of an altstep cannot contain a component variable used as an actual inout parameter + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_054 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + var integer vc_int := 0; + } + + function f_inout (inout integer p_inout) { + p_inout := 1; + } + + function f_test() runs on GeneralComp return boolean { + f_inout(vc_int); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_054() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_054()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_055.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..025699adcfb1d84876ee59bd4fe05d2171671b07 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_055.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the setverdict operation cannot be used in guard statements of altstep + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_055 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return boolean { + setverdict(pass); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_055() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_055()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_056.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd4196c0fce4961681f71ba33214ffc2a6eaedd9 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_056.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the activate operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_056 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + activate(a_anyTimer()); + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_056() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_056()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_057.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0016dd046a4a1433e33fef3a5b71ae40b5ccba5 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_057.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the deactivate operation cannot be used in parameters of altsteps invoked from an alt branch + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_057 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + function f_test() runs on GeneralComp return boolean { + deactivate; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_057() runs on GeneralComp system GeneralComp { + activate(a_anyTimer()); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_057()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_058.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..398652b393fb85c18362bcc58490859fdec64dde --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_058.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain out parameters + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_058 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(out integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_058() runs on GeneralComp system GeneralComp { + var integer v_int := 0; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_int)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_058()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_059.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa2703a71decfd4bdf8cf00acc0048ddfff49eac --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_059.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain inout parameters + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_059 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test(inout integer p_par) runs on GeneralComp return boolean { + p_par := 1; + return true; + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_059() runs on GeneralComp system GeneralComp { + var integer v_int := 0; + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_int)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_059()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_060.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..676b37927b4ac77eaf008129c967172b5745f976 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_060.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_060 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_060() runs on GeneralComp { + timer t_tmr := 1.0; + t_tmr.start; + p.send(m_test); + alt { + [t_tmr.read > 0.0] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_060()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_061.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..033444ff067c61047f088f29eaa71f9c5a63d512 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_061.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in guard statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// b) The evaluation of a Boolean expression guarding an alternative shall not have side effects. To avoid side effects +// that cause an inconsistency between the actual snapshot and the state of the component, the same restrictions +// as the restrictions for the initialization of local definitions within altsteps (clause 16.2) and the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply. + +module NegSem_2002_TheAltStatement_061 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2002_TheAltStatement_061() runs on GeneralComp { + p.send(m_test); + alt { + [p.checkstate("Started")] p.receive(charstring:?) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_061()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_062.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..004294c943fd2e235271c8869f3f7e0c68815f23 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_062.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_062 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_062() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(boolean:t_tmr.read > 0.0) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_062()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_063.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34d441d5ec27bfc1042ce2d203036a2036f4714e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_063.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in alt branch events (in inline templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_063 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_063() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(boolean:p.checkstate("Started")) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_063()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_064.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1329dbbb605de8a4e092ff1291f052558d3c053 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_064.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_064 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_064() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] a_receive(t_tmr.read > 0.0); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_064()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_065.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..745d0d1bd7338db4e754bd026d2ab1b2eb287c8f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_065.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in parameters of alt branch events + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_065 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive(boolean p_bool) runs on GeneralComp { + [] p.receive(p_bool) { + setverdict(pass); + } + } + + testcase TC_NegSem_2002_TheAltStatement_065() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_receive(p.checkstate("Started")); + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_065()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_066.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b03e087ef465f912db98f2b80b004a16912f492 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_066.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in alt branch events (in inline template) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_066 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_066() runs on GeneralComp system GeneralComp { + template @fuzzy boolean mw_msg := GeneralComp.create != null; + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_066()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_067.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..056e25ab523ed849055ef707419af140e91e868d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_067.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_067 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_067() runs on GeneralComp system GeneralComp { + template @fuzzy boolean mw_msg := mtc.running; + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_067()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_068.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5c2a3e021b3e84bc2ca8643f669dc577b0d1e86 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_068.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_068 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_068() runs on GeneralComp system GeneralComp { + template @fuzzy boolean mw_msg := mtc.alive; + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_068()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_069.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf244206b8e715ea9b18a01a83e4b2cf9887c53e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_069.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_069 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_069() runs on GeneralComp system GeneralComp { + template @fuzzy boolean mw_msg := p.checkstate("Started"); + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_069()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_070.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e39737848c4b91bc2d8a56646e9e19bef23ffeaf --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_070.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_070 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_070() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + template @fuzzy boolean mw_msg := t_tmr.running; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_070()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_071.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5360dca5acd8d07b2bc96193a036b65a883ae488 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_071.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_071 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2002_TheAltStatement_071() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + template @fuzzy boolean mw_msg := t_tmr.read > 0.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_071()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_072.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae4d1cd57982b721caf7f1a58a0715a144d22e65 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_072.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in alt branch events (in templates) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_072 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_timeout() { + [] any timer.timeout { + } + } + + testcase TC_NegSem_2002_TheAltStatement_072() runs on GeneralComp system GeneralComp { + template @fuzzy boolean mw_msg := activate(a_timeout()) != null; + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_072()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_073.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e1c8b701926d071ff6ecafa16a07a300070f41e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_073.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in alt branch events (in inline template) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_073 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_073() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg(GeneralComp.create != null)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_073()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_074.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35b9050fc92f59ad3fba38fdc5eb8da7fbc0d3f2 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_074.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_074 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_074() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg(mtc.running)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_074()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_075.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c024cda966bf9648d7a9d99d1b64a88ac0b0fb6b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_075.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_075 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_075() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg(mtc.alive)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_075()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_076.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87bffcff654c336bab86a5d3839cb0f8e9eebc63 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_076.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_076 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_076() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg(p.checkstate("Started"))) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_076()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_077.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3b11459ee340a91c0f1e4c118650e7bd1c5c7d0 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_077.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_077 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_077() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(mw_msg(t_tmr.running)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_077()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_078.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98cc788272835bc205119e7bd37e5222eb529e00 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_078.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_078 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_078() runs on GeneralComp system GeneralComp { + timer t_tmr := 1.0; + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] p.receive(mw_msg(t_tmr.read > 0.0)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_078()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_079.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86e85c4c925d4aa6a1cb359a2038c39224be89ac --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_079.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in alt branch events (in template parameters) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause +// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism +// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions +// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions +// occurring in the matching part of an alternative. + +module NegSem_2002_TheAltStatement_079 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_timeout() { + [] any timer.timeout { + } + } + + template boolean mw_msg (boolean p_par) := (false, p_par); + + testcase TC_NegSem_2002_TheAltStatement_079() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] p.receive(mw_msg(activate(a_timeout()) != null)) { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_2002_TheAltStatement_079()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_080.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fb29a61e6a9e02590d3759b47bba069bd602b9f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_080.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the create operation cannot be used in alt branch events (in inline template) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_080 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := GeneralComp.create != null; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_080() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_080()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_081.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d967cd7bae4bf4a397d22d01a35c4f5113bb5cb6 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_081.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the component.running operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_081 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := mtc.running; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_081() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_081()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_082.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd3a3b8021112ad191cd2da2acc21ff94b54a424 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_082.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the alive operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_082 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := mtc.alive; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_082() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_082()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_083.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..63cd86ea20ea13f283c7f1a3671e8a050b89340b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_083.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the checkstate operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_083 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := p.checkstate("Started"); + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_083() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_083()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_084.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba69a961fa451e5423fcaf26d66d56147ab4d2c1 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_084.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the timer.running operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_084 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + timer t_tmr := 1.0; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := t_tmr.running; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_084() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_084()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_085.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6661dbaa177d8986048d5a34e0a4f18807cfd42 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_085.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that the read operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_085 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + timer t_tmr := 1.0; + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := t_tmr.read > 0.0; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_085() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + t_tmr.start; + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_085()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_086.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d89bda3f77c6783a37d5721e733c1bd1de2daca3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_086.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:20.2, verify that the activate operation cannot be used in altstep declarations + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_086 { + + type port MyPort message { + inout boolean + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_timeout() { + [] any timer.timeout{ + } + } + + altstep a_rcv() runs on GeneralComp { + var boolean v_bool := activate(a_timeout()) != null; + [v_bool] p.receive(boolean:?){ + } + } + + testcase TC_NegSem_2002_TheAltStatement_086() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(true); + alt { + [] a_rcv(); + [] any timer.timeout { + } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_086()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_087.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..941fcfe673ae4486b5b2bb1c8ca2f26d455eb391 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_087.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_087 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_eval() return integer { + return 10; + } + + function f_test(@fuzzy integer p_par) return boolean { + if (p_par > 0) { + return true; + } else { + return false; + } + } + + altstep a_rcv(boolean p_par) runs on GeneralComp { + [p_par] p.receive(integer:?) {} + } + + testcase TC_NegSem_2002_TheAltStatement_087() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_int)) {} + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_087()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_088.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66c505d4ee40ba7120a96099fcac179e9e8bf4cf --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_088.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a external function used in a parameter of an altstep invoked from an alt branch cannot contain fuzzy parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_088 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_anyTimer() runs on GeneralComp { + [] any timer.timeout {} + } + + external function @deterministic f_test(@fuzzy integer p_par) return boolean; + + altstep a_rcv(@fuzzy boolean p_par) runs on GeneralComp { + [p_par] p.receive(integer:?) {} + } + + function f_eval() return integer { + return 10; + } + + testcase TC_NegSem_2002_TheAltStatement_088() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_int := f_eval(); + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test(v_int)); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_088()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_089.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a333ee1118c3436a2bd0bb0a9e763437695d82de --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_089.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain fuzzy variables + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_089 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() return integer { + var @fuzzy integer v_int := f_eval(); + return v_int; + } + + + altstep a_rcv(integer p_par) runs on GeneralComp { + [] p.receive(p_par) {} + } + + function f_eval() return integer { + return 1; + } + + testcase TC_NegSem_2002_TheAltStatement_089() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_089()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_090.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d79f5cddfe2f713cf1670bf1ae9c48d6bd2c8ed3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/NegSem_2002_TheAltStatement_090.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:20.2, verify that a function used in a parameter of an altstep invoked from an alt branch cannot contain the setencode operation + ** @verdict pass reject +***************************************************/ + +// The following requirement is tested: +// d) The evaluation of an altstep invoked from an alt branch, if none of the alternatives in the altstep is chosen, shall +// not have side effects. To avoid side effects the restrictions imposed on the contents of functions called from special +// places (clause 16.1.4) shall apply to the actual parameters of the invoked altstep. + +module NegSem_2002_TheAltStatement_090 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_test() runs on GeneralComp return integer { + p.setencode(integer, "Binary"); + return 1; + } + + altstep a_rcv(integer p_par) runs on GeneralComp { + [] p.receive(p_par) {} + } + + testcase TC_NegSem_2002_TheAltStatement_090() runs on GeneralComp system GeneralComp { + connect(mtc:p, mtc:p); + p.send(1); + alt { + [] a_rcv(f_test()); + [] any timer.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2002_TheAltStatement_090()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15407b85864ceefc89888169e11c9d1f8213f05b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_001.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement works as expected (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_001 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_test := "ping"; + +testcase TC_Sem_2002_TheAltStatement_001() runs on GeneralComp { + p.send(m_test); + alt { + [] p.receive(m_test) { + setverdict(pass); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59110e58c2271f9c4e5485efe2fd188403b6d07b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement with a guard works as expected (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_002 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_test := "ping"; + +testcase TC_Sem_2002_TheAltStatement_002() runs on GeneralComp { + var integer counter := 1; + p.send(m_test); + alt { + [counter == 1] p.receive(m_test) { + setverdict(pass); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_002()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fff372bdd6845caffc16a0bf39761c4010254c5 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the alt-statement processes the alternatives in order (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_003 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_test := "ping"; + +testcase TC_Sem_2002_TheAltStatement_003() runs on GeneralComp { + p.send(m_test); + alt { + [] p.receive(m_test) { + setverdict(pass); + } + [] p.receive(m_test) { + setverdict(fail); + } + [] p.receive(m_test) { + setverdict(fail); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_003()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb455217266ac3c7339a3552e939d81cb5196196 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_004.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that activated defaults are processed in the reverse order (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_004 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; +template charstring m_testThree := "ping3"; // never sent! + +altstep a_first() runs on GeneralComp { + [] p.receive(m_testTwo) { + setverdict(fail); + } +} + +altstep a_second() runs on GeneralComp { + [] p.receive(m_testOne) { + setverdict(pass); + } +} + +testcase TC_Sem_2002_TheAltStatement_004() runs on GeneralComp { + var default v_defaultOne := activate(a_first()); + var default v_defaultTwo := activate(a_second()); + + p.send(m_testOne); + p.send(m_testTwo); + + alt { + [] p.receive(m_testThree) { + setverdict(fail); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_004(), 2.0); // if the altstep isn't handled after 2s, we raise an error +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b1cf965b850ed9d0f0a393e1475711874234b1e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_005.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the else branch is executed when nothing else matched (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_005 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +testcase TC_Sem_2002_TheAltStatement_005() runs on GeneralComp { + p.send(m_testOne); + p.send(m_testOne); + + alt { + [] p.receive(m_testTwo) { + setverdict(fail); + } + [false] p.receive(m_testTwo) { + setverdict(fail); + } + [else] { + setverdict(pass); + } + } + + setverdict(pass); +} + +control { + execute(TC_Sem_2002_TheAltStatement_005(), 2.0); // if the altstep isn't handled after 2s, we raise an error +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..89dbad3278678e13a0b2f78e91a1c44edcfd67c3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_006.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 409 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, Ensure that an altstep invocation works as expected (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_006 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +altstep a_test() runs on GeneralComp { + [] p.receive(m_testOne) { + setverdict(pass); + } +} + +testcase TC_Sem_2002_TheAltStatement_006() runs on GeneralComp { + timer t_tmr := 0.5; + t_tmr.start; + p.send(m_testOne); + t_tmr.timeout; // wait for some time for the answer + alt { + [] a_test(); + [else] { + setverdict(fail); + } + } + + setverdict(pass); +} + +control { + execute(TC_Sem_2002_TheAltStatement_006()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_007.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fa4a7febbc71145afec776c528ac108b73034d0 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_007.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 409 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.2, Ensure that an altstep invocation works as expected and that the optional statement block is executed after the altstep staatement block (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_007 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; + var boolean v_visitedAltstep := false; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +altstep a_test() runs on GeneralComp { + [] p.receive(m_testOne) { + v_visitedAltstep := true; + } +} + +testcase TC_Sem_2002_TheAltStatement_007() runs on GeneralComp { + timer t_tmr := 0.5; + t_tmr.start; + p.send(m_testOne); + t_tmr.timeout; // wait for some time for the answer + + alt { + [] a_test() { + if (v_visitedAltstep == true) { + setverdict(pass); + } + } + [else] { + setverdict(fail); + } + } + + setverdict(pass); +} + +control { + execute(TC_Sem_2002_TheAltStatement_007()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_008.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f52bc8956fcecca0e1f990dac623833111fb3d09 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_008.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the done-block in an alt-statement is triggered as expected (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_008 { + +type port MyPort message { + inout charstring +} + +type component MTCComp { + port MyPort p; +} + +type component PTCComp { + port MyPort p; +} + +type component SystemComp { + port MyPort p; +} + +function f_secondComponent() runs on PTCComp { +} + +testcase TC_Sem_2002_TheAltStatement_008() runs on MTCComp system SystemComp { + var PTCComp v_ptc := PTCComp.create alive; + map(self:p, system:p); + v_ptc.start(f_secondComponent()); + + alt { + [] v_ptc.killed { + setverdict(fail); // as we have an alive component, it shouldn't have the killed status here + } + [] v_ptc.done { + setverdict(pass); + } + } + v_ptc.kill; +} + +control { + execute(TC_Sem_2002_TheAltStatement_008()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_009.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45be3cdf06350b557a83032648149c2e7c63879a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_009.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the killed-block in an alt-statement is triggered as expected when the component is killed (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_009 { + +type port MyPort message { + inout charstring +} + +type component SystemComp { + port MyPort p; +} + +type component MTCComp { + port MyPort p; +} + +type component PTCComp { + port MyPort p; +} + +function f_secondComponent() runs on PTCComp { +} + +testcase TC_Sem_2002_TheAltStatement_009() runs on MTCComp system SystemComp { + var PTCComp v_ptc := PTCComp.create; + map(self:p, system:p); + v_ptc.start(f_secondComponent()); + v_ptc.kill; + + alt { + [] v_ptc.killed { + setverdict(pass); + } + [else] { + setverdict(fail); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_009()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_010.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55e86d8e4285f893dac2fb7241726d31e3daa2ce --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_010.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the timeout branch is taken as expected (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_010 { + +type component GeneralComp { } + +testcase TC_Sem_2002_TheAltStatement_010() runs on GeneralComp { + timer t_timer; + + t_timer.start(20E-3); + + alt { // block until a timeout happens in 20ms + [] t_timer.timeout { + setverdict(pass); + } + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_010(), 200E-3); // timeout in 100ms, then error +} +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_011.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06982c2040a280dc2619a3a41b1f138a12e9bfaf --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_011.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that the behavior continues after the alt-statement (loopback case). + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2002_TheAltStatement_011 { + +type component GeneralComp { } + +testcase TC_Sem_2002_TheAltStatement_011() runs on GeneralComp { + timer t_timer; + var boolean v_altVisited := false; + + t_timer.start(20E-3); + alt { // block until a timeout happens in 20ms + [] t_timer.timeout { + v_altVisited := true; + } + } + + if (v_altVisited == true) { + setverdict(pass); + } else { + setverdict(fail); // for some reason the alt has not been processed correctly. + } +} + +control { + execute(TC_Sem_2002_TheAltStatement_011(), 200E-3); // timeout in 100ms, then error +} +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_012.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b4c16ad67a25bf7568691933c301a7524034d0f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_012.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that alt statements are correctly handled for dynamically mapped ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Mycompport A is dynamically mapped +module Sem_2002_TheAltStatement_012{ + + type port loopbackPort message { + inout integer + } + + type port IntegerOutputPortType message { + inout integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } + +// MyTestSystemInterface is the test system interface +testcase TC_Sem_2002_TheAltStatement_012() runs on GeneralComp system MyTestSystemInterface { + timer tc_timer := 0.1; + map(mtc:MycomportA, system:messagePort); + + + MycomportA.send(2); + tc_timer.start; + unmap(mtc:MycomportA); + setverdict(pass); + + alt { + [] MycomportA.receive { + } + [] tc_timer.timeout { + setverdict(pass); + } + } +} +control{ + execute(TC_Sem_2002_TheAltStatement_012()); +} +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_013.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..664ebf3d4e7090e71da9241ff8bf136a6128847b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_013.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:20.2, Ensure that alt statements are correctly handled for dynamically mapped ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// Mycompport A is dynamically mapped +module Sem_2002_TheAltStatement_013{ + + type port loopbackPort message { + inout integer + } + + type port IntegerOutputPortType message { + inout integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } + +// MyTestSystemInterface is the test system interface +testcase TC_Sem_2002_TheAltStatement_013() runs on GeneralComp system MyTestSystemInterface { + timer tc_timer := 0.1; + map(mtc:MycomportA, system:messagePort); + + + MycomportA.send(2); + tc_timer.start; + unmap(mtc:MycomportA); + + alt { + [] tc_timer.timeout { + MycomportA.clear; + setverdict(pass); + } + } +} +control{ + execute(TC_Sem_2002_TheAltStatement_013()); +} +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_014.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebb8cfc7af33b573b8d27832cb7b44a9c2eec4a3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_014.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.2, no default activation after else + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If an else branch is defined, the default mechanism will never be called, +// i.e. active defaults will never be entered. + +module Sem_2002_TheAltStatement_014 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive() runs on GeneralComp { + [] p.receive { + setverdict(fail); + } + } + + testcase TC_Sem_2002_TheAltStatement_014() runs on GeneralComp system GeneralComp { + map(self:p, system: p); + p.send(charstring:"abc"); + activate(a_receive()); + alt { + [] p.receive(charstring:"def") { + setverdict(fail); + } + [else] { + setverdict(pass); + } + } + } + + control { + execute(TC_Sem_2002_TheAltStatement_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/NegSem_2003_the_repeat_statement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/NegSem_2003_the_repeat_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa560617ed802484306f83c79d2f23f0c93dc463 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/NegSem_2003_the_repeat_statement_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.3, Ensure that the IUT correctly processes repeat statements + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2003_the_repeat_statement_001 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + template charstring m_test := "ping"; + + testcase TC_NegSem_2003_the_repeat_statement_001() runs on GeneralComp { + var integer counter := 1; + p.send(m_test); + p.send(m_test); + alt { + [counter == 1] p.receive(m_test) { + counter := 2; + repeat; + } + [counter == 2] p.receive(m_test) { + setverdict(pass); + } + } + repeat; //repeat statement is used outside of an alt or call structure + } + + control { + execute(TC_NegSem_2003_the_repeat_statement_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03205f01846fe7a45445a3e3495458bba95878fe --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20.3, Ensure that the IUT correctly processes repeat statements + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2003_the_repeat_statement_001 { + + type port loopbackPort message { + inout charstring + } + + type component GeneralComp { + port loopbackPort p; + } + + template charstring m_test := "ping"; + + testcase TC_Sem_2003_the_repeat_statement_001() runs on GeneralComp { + timer t:= 5.0; + var integer counter := 1; + + p.send(m_test); + p.send(m_test); + + t.start; + alt { + [counter == 1] p.receive(m_test) { + counter := 2; + repeat; + } + [counter == 2] p.receive(m_test) { + setverdict(pass); + } + [] t.timeout { + setverdict(fail); + } + } + } + + control { + execute(TC_Sem_2003_the_repeat_statement_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f5aec0d190724ac481a23fa6a5232ba8ead5d05c --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_002.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.2, repeat in procedure call block + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// When used in statement blocks of the response and exception handling parts +// of blocking procedure calls, the repeat statement causes the re-evaluation +// of the response and exception handling part of the call (see clause 22.3.1). + +module Sem_2003_the_repeat_statement_002 { + + signature S(); + + type port MyPort procedure { + inout S; + } + + type component GeneralComp { + port MyPort p; + } + + function f_mirror() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_2003_the_repeat_statement_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc[2]; + var integer v_counter := 0; + for(var integer i := 0; i < 2; i := i + 1) { + v_ptc[i] := GeneralComp.create; + connect(self:p, v_ptc[i]:p); + v_ptc[i].start(f_mirror()); + } + p.call(S:{}) to all component { // broadcast call (several replies expected) + [] p.getreply(S:?) { + v_counter := v_counter + 1; + if (v_counter < lengthof(v_ptc)) { repeat; } // tested repeat + else { setverdict(pass); } + } + } + } + + control { + execute(TC_Sem_2003_the_repeat_statement_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e05c51d7f7fc2353d53fa0b8cd50839ba6fc5a0f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_003.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.2, repeat in alstep branch of alt statements + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If a repeat statement is used in a top alternative in an altstep definition, +// it causes a new snapshot and the re-evaluation of the alt statement from +// which the altstep has been called. The call of the altstep may either be +// done implicitly by the default mechanism (see clause 20.5.1) or explicitly +// in the alt statement (see clause 20.2). + +module Sem_2003_the_repeat_statement_003 { + + type port MyPort message { + inout charstring; + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receiveAny() runs on GeneralComp { + [] p.receive(charstring:?) { + repeat; + } + } + + testcase TC_Sem_2003_the_repeat_statement_003() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + alt { + [] p.receive(charstring:"bar") { + setverdict(pass); + } + [] a_receiveAny(); + } + } + + control { + execute(TC_Sem_2003_the_repeat_statement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f75ca7f56c7295640c3a33554d62c2065a0c0d9b --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2003_the_repeat_statement/Sem_2003_the_repeat_statement_004.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.2, repeat in executed default + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If a repeat statement is used in a top alternative in an altstep definition, +// it causes a new snapshot and the re-evaluation of the alt statement from +// which the altstep has been called. The call of the altstep may either be +// done implicitly by the default mechanism (see clause 20.5.1) or explicitly +// in the alt statement (see clause 20.2). + +module Sem_2003_the_repeat_statement_004 { + + type port MyPort message { + inout charstring; + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receiveAny() runs on GeneralComp { + [] p.receive(charstring:?) { + repeat; + } + } + + testcase TC_Sem_2003_the_repeat_statement_004() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + activate(a_receiveAny()); + alt { + [] p.receive(charstring:"bar") { + setverdict(pass); + } + } + } + + control { + execute(TC_Sem_2003_the_repeat_statement_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a09b2b8d6f14ee438f37bb579411e1876cabffb9 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_001.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2004_InterleaveStatement_001 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_NegSem_2004_InterleaveStatement_001() runs on GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + var integer v_i; + timer t_timer; + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + t_timer.start(1.0); + + interleave { + [] pt_myPort1.receive(MySig1) + { + for(v_i:=1; v_i<10; v_i:= v_i+1) { //control transfer statement is not allowed + pt_myPort2.send(MySig2); + } + alt { + [] pt_myPort1.receive(MySig3) { + setverdict(pass); + } + [] t_timer.timeout { + setverdict(fail); + } + } + } + [] pt_myPort2.receive(MySig2) //boolean guard must be empty + { + pt_myPort1.send(MySig3); + } + + } + + + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d832aca51edcc8db3c17b202a565f7477faf638 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_002.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.2 + ** @purpose 1:20.4, verify a while loop cannot be used inside interleave together with reception statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// a. The loop statements for, while, and do-while can be used within statements blocks that do not +// contain reception statements. + +module NegSem_2004_InterleaveStatement_002 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_002() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + for(var integer i := 0; i < 5; i := i + 1) { + p.send("ding"); + } + + interleave { + [] p.receive(charstring:"bar") { + var integer v_counter := 0; + while(v_counter < 5) { + v_counter := v_counter + 1; + p.receive; + } + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cdf9543785dc5675524677ea24b45074920d5251 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_003.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.2 + ** @purpose 1:20.4, verify a do-while loop cannot be used inside interleave together with reception statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// a. The loop statements for, while, and do-while can be used within statements blocks that do not +// contain reception statements. + +module NegSem_2004_InterleaveStatement_003 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_003() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + for(var integer i := 0; i < 5; i := i + 1) { + p.send("ding"); + } + interleave { + [] p.receive(charstring:"bar") { + var integer v_counter := 0; + do { + v_counter := v_counter + 1; + p.receive; + } while(v_counter < 5); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67378a27b8ba8cf3b66c273a2b18b1f59c8d9b76 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_004.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.2 + ** @purpose 1:20.4, verify that goto cannot be inside interleave if used together with reception statements + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// b. The goto statement can be used for defining unconditional jumps within statements blocks that do not +// contain reception statements and for specifying unconditional jumps out of interleave statements. + +module NegSem_2004_InterleaveStatement_004 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_004() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + p.send(charstring:"ding"); + + interleave { + [] p.receive(charstring:"bar") { + goto L1; + label L1; + p.receive(charstring:"ding"); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aaba1f2ecc60972599d7611a5a5e3ab324f915cd --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, activate call inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_005 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_timeout() { + [] any timer.timeout { + } + } + + testcase TC_NegSem_2004_InterleaveStatement_005() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + activate(a_timeout()); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f226dbcb574b7a182b799d4e84606ad4b8011f69 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_006.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, deactivate call inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_006 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_006() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + deactivate; + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_008.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35ec46cff7d727eeace5d73d655f2e8cf3dfdd4c --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_008.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, repeat inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_008 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_008() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + repeat; + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_010.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a235a18452ab44bbceb1bf857d210e19e3a31774 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_010.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, explicit altstep call inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_010 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive() runs on GeneralComp { + [] p.receive(charstring:?) { + } + } + + testcase TC_NegSem_2004_InterleaveStatement_010() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + p.send(charstring:"ding"); + + interleave { + [] p.receive(charstring:"bar") { + a_receive(); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_011.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48b259467633d8004df678c228da5c634133702f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_011.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, direct function call containing reception statement inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_011 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + function f_receive() runs on GeneralComp { + p.receive(charstring:?); + } + + testcase TC_NegSem_2004_InterleaveStatement_011() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + p.send(charstring:"ding"); + + interleave { + [] p.receive(charstring:"bar") { + f_receive(); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_012.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b58b1789a166d1befd4adbe67b53d87a3133bec --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_012.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, indirect function call containing reception statement inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Control transfer statements for, while, do-while, goto, activate, +// deactivate, stop, repeat, return, direct call of altsteps as alternatives +// and (direct and indirect) calls of user-defined functions, which include +// reception statements, shall not be used in interleave statements. + +module NegSem_2004_InterleaveStatement_012 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + function f_receive() runs on GeneralComp { + p.receive(charstring:?); + } + + function f_caller(boolean p_choice) runs on GeneralComp { + if (p_choice) { + f_receive(); + } + } + + testcase TC_NegSem_2004_InterleaveStatement_012() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + p.send(charstring:"ding"); + + interleave { + [] p.receive(charstring:"bar") { + f_caller(true); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_013.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ed84d30b574595e1dae3e2744c0dfb6c60b77074 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSem_2004_InterleaveStatement_013.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that conditional goto cannot be inside interleave + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// b. The goto statement can be used for defining unconditional jumps within statements blocks that do not +// contain reception statements and for specifying unconditional jumps out of interleave statements. + +module NegSem_2004_InterleaveStatement_013 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_NegSem_2004_InterleaveStatement_013() runs on GeneralComp { + var boolean v_cond := true; + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + if (v_cond) { + goto L1; + } + } + [] p.receive(charstring:"foo") { + } + } + label L1; + setverdict(pass); + } + + control{ + execute(TC_NegSem_2004_InterleaveStatement_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1dd1c7a2dea9ead68b875b021462ac9ff969e183 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_001.ttcn @@ -0,0 +1,62 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass reject + *****************************************************************/ + +module NegSyn_2004_InterleaveStatement_001 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_NegSyn_2004_InterleaveStatement_001() runs on GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + timer t_timer; + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + t_timer.start(1.0); + + interleave { + [] pt_myPort1.receive(MySig1) + { + pt_myPort2.send(MySig2); + alt { + [] pt_myPort1.receive(MySig3) { + setverdict(pass); + } + [] t_timer.timeout { + setverdict(fail); + } + } + } + [] pt_myPort2.receive(MySig2) + { + pt_myPort1.send(MySig3); + } + [else] { + setverdict(pass); + } + } + + + } + + control{ + execute(TC_NegSyn_2004_InterleaveStatement_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab077c9ac453522a31f6ffe6bd5c540d86a6c667 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/NegSyn_2004_InterleaveStatement_002.ttcn @@ -0,0 +1,61 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass reject + *****************************************************************/ + +module NegSyn_2004_InterleaveStatement_002 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_NegSyn_2004_InterleaveStatement_002() runs on GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + timer t_timer; + var integer v:=1; + t_timer.start(1.0); + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + + interleave { + [v>0] pt_myPort1.receive(MySig1) //boolean guard must be empty + { + pt_myPort2.send(MySig2); + alt { + [] pt_myPort1.receive(MySig3) { + setverdict(pass); + } + [] t_timer.timeout { + setverdict(fail); + } + } + } + [v<0] pt_myPort2.receive(MySig2) //boolean guard must be empty + { + pt_myPort1.send(MySig3); + } + + } + + + } + + control{ + execute(TC_NegSyn_2004_InterleaveStatement_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17c02182345ddffeb1f52f30174e4c764f6c7aa8 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_001.ttcn @@ -0,0 +1,66 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2004_InterleaveStatement_001 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + timer t_timer; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + altstep checkTimeout(timer t_timer){ + [] t_timer.timeout { + setverdict(fail); + } + } + + testcase TC_Sem_2004_InterleaveStatement_001() runs on GeneralComp system GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + map(mtc:pt_myPort1, system:pt_myPort1); + map(mtc:pt_myPort2, system:pt_myPort2); + + activate(checkTimeout(t_timer)); + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + t_timer.start(3.0); + + interleave { + [] pt_myPort1.receive(MySig1) + { + pt_myPort2.send(MySig2); + alt { + [] pt_myPort1.receive(MySig3) { + setverdict(pass); + } + } + } + [] pt_myPort2.receive(MySig2) + { + pt_myPort1.send(MySig3); + } + } + + + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b6f34dca11a8e91bc1a5e2f4717aab2f00fe95f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_002.ttcn @@ -0,0 +1,67 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2004_InterleaveStatement_002 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + altstep checkTimeout(timer t_timer){ + [] t_timer.timeout { + setverdict(fail); + } + } + + testcase TC_Sem_2004_InterleaveStatement_002() runs on GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + timer t_timer; + + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + + t_timer.start(1.0); + + interleave { + [] pt_myPort1.receive(MySig1) + { + pt_myPort2.send(MySig2); + alt { + [] pt_myPort1.receive(MySig3) { + setverdict(fail); + } + } + } + [] pt_myPort2.receive(MySig2) + { + setverdict(pass); + break; //evaluation of correct exit from interleave + pt_myPort1.send(MySig3); + setverdict(fail); + } + } + + + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6d8fabd141b04bae89772999448f636e272120f --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_003.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.4, while loop inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If none of the alternatives of the interleave statement can be executed, +// the default mechanism will be invoked. This means, according to the +// semantics of the default mechanism, the actual snapshot will be used to +// evaluate those altsteps that have been activated before entering the +// interleave statement. + +module Sem_2004_InterleaveStatement_003 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + altstep a_receive() runs on GeneralComp { + [] p.receive(charstring:?) { + setverdict(pass, "default called"); + } + } + + testcase TC_Sem_2004_InterleaveStatement_003() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"ding"); + p.send(charstring:"bar"); + activate(a_receive()); + + interleave { + [] p.receive(charstring:"bar") { // should not be called, because the default is invoked instead + setverdict(fail, "default not used properly!!!"); + } + [] p.receive(charstring:"foo") { + setverdict(pass, "foo received"); + } + } + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7017bbb3fca0db4b9a130d2e4be9d2354dec8e8 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_004.ttcn @@ -0,0 +1,65 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that a for loop can be used inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// a. The loop statements for, while, and do-while can be used within statements blocks that do not +// contain reception statements. + + +module Sem_2004_InterleaveStatement_004 { + + type port loopbackPort message { + inout MyMessageType + } + + type component GeneralComp { + port loopbackPort pt_myPort1,pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_Sem_2004_InterleaveStatement_004() runs on GeneralComp { + + template MyMessageType MySig1 := {1,"aaa",true}; + template MyMessageType MySig2 := {2,"bbb",true}; + template MyMessageType MySig3 := {3,"ccc",true}; + + var integer v_i; + timer t_timer; + pt_myPort1.send(MyMessageType:{1, "aaa", true}); + t_timer.start(1.0); + + interleave { + [] pt_myPort1.receive(MySig1) + { + var integer v_counter := 0; + for(v_i:=1; v_i<10; v_i:= v_i+1) { //control transfer statement is not allowed + v_counter := v_counter + 1; + } + log (v_counter); + } + [] pt_myPort2.receive(MySig2) //boolean guard must be empty + { + pt_myPort1.send(MySig3); + } + + } + + + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b17f4d76102bee89f5ce62813245bd1f90e5b5d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_005.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that while loop can be used inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// a. The loop statements for, while, and do-while can be used within statements blocks that do not +// contain reception statements. + +module Sem_2004_InterleaveStatement_005 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_005() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + var integer v_counter := 0; + while(v_counter < 5) { + v_counter := v_counter + 1; + } + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e73f641fb65743387748971407dee7ff2d4b695 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_006.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that a do-while loop can be used inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// a. The loop statements for, while, and do-while can be used within statements blocks that do not +// contain reception statements. + +module Sem_2004_InterleaveStatement_006 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_006() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + var integer v_counter := 0; + do { + v_counter := v_counter + 1; + } while(v_counter < 5); + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_007.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06b5a283cd2f6001ad6afcf4a7b0f3fe05b7473d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_007.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that goto can be used for jumps out of interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// b. The goto statement can be used for defining unconditional jumps within statements blocks that do not +// contain reception statements and for specifying unconditional jumps out of interleave statements. + +module Sem_2004_InterleaveStatement_007 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_007() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + goto L1; + } + [] p.receive(charstring:"foo") { + } + } + label L1; + setverdict(pass); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_008.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b434f66593ecb1901818c35ac06d884b690a2546 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_008.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.1 + ** @purpose 1:20.4, verify that goto can be used inside interleave for jumps within statement blocks + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction d) +// The restricted use of the control transfer statements for, while, do-while, and goto within interleave +// statements is allowed under the following conditions: +// b. The goto statement can be used for defining unconditional jumps within statements blocks that do not +// contain reception statements and for specifying unconditional jumps out of interleave statements. + +module Sem_2004_InterleaveStatement_008 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_008() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + log ("inside interleave"); + goto L1; + label L1; + } + [] p.receive(charstring:"foo") { + } + } + setverdict(pass); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_009.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f253d11d0f390f13f82e9cca579ecdc479a999a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_009.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.2 + ** @purpose 1:20.4, stop inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// Background: +// The stop statement was forbidden inside interleave in TTCN-3:2016 and older + +module Sem_2004_InterleaveStatement_009 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + testcase TC_Sem_2004_InterleaveStatement_009() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + + interleave { + [] p.receive(charstring:"bar") { + setverdict(pass); + stop; + } + [] p.receive(charstring:"foo") { + } + } + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_010.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dba2077d3a6b3a8d7671903c75b99a44c4a299a4 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Sem_2004_InterleaveStatement_010.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 584 + ** @version 0.0.2 + ** @purpose 1:20.4, return inside interleave + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// Background: +// The return statement was forbidden inside interleave in TTCN-3:2016 and older + +module Sem_2004_InterleaveStatement_010 { + + type port MyPort message { + inout charstring + } + + type component GeneralComp { + port MyPort p; + } + + function f_interleave() runs on GeneralComp { + interleave { + [] p.receive(charstring:"bar") { + setverdict(pass); + return; + } + [] p.receive(charstring:"foo") { + } + } + } + + testcase TC_Sem_2004_InterleaveStatement_010() runs on GeneralComp { + p.send(charstring:"foo"); + p.send(charstring:"bar"); + f_interleave(); + } + + control{ + execute(TC_Sem_2004_InterleaveStatement_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Syn_2004_InterleaveStatement_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Syn_2004_InterleaveStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e9abd60c9eb34aa7d41dcc8ccb323a37df54859 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2004_the_interleave_statement/Syn_2004_InterleaveStatement_001.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:20.4, Validate that interleave statements are properly handled. + ** @verdict pass accept, noexecution + *****************************************************************/ +module Syn_2004_InterleaveStatement_001 { + type port MyMessagePortType message { + inout MyMessageType; + } + + type component GeneralComp { + port MyMessagePortType pt_myPort1, pt_myPort2; + } + + type record MyMessageType { + integer field1, + charstring field2, + boolean field3 + } + + testcase TC_Syn_2004_InterleaveStatement_001() runs on GeneralComp { + + template MyMessageType MySig1 := {1, "abc", true} + template MyMessageType MySig2 := MySig1; + template MyMessageType MySig3 := MySig1; + template MyMessageType MySig4 := MySig1; + template MyMessageType MySig5 := MySig1; + template MyMessageType MySig6 := MySig1; + + pt_myPort1 + .send(MyMessageType: + { + 2, + "abcxyz", + true + }); + + interleave { + [] pt_myPort1.receive(MySig1) { + pt_myPort1.send(MySig2); + pt_myPort1.receive(MySig3); + } + [] pt_myPort2.receive(MySig4) { + pt_myPort2.send(MySig5); + pt_myPort2.receive(MySig6); + } + } + } + control { + execute(TC_Syn_2004_InterleaveStatement_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/NegSem_200501_the_default_mechanism_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/NegSem_200501_the_default_mechanism_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..341bdf2f1bcc0150c84cad4b3d43490ade4e94b6 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/NegSem_200501_the_default_mechanism_001.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify unsuccessful default termination + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For each test component the defaults, i.e. activated altsteps, are stored as an ordered +// list. The defaults are listed in the reversed order of their activation i.e. the last +// activated default is the first element in the list of active defaults. + +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +// In the case of an unsuccessful termination, the default mechanism invokes the next +// default in the list. If the last default in the list has terminated unsuccessfully, +// the default mechanism will return to the place in the alt statement in which it +// has been invoked, i.e. at the end of the alt statement, and indicate an unsuccessful +// default execution. An unsuccessful default execution will also be indicated if the list +// of defaults is empty. An unsuccessful default execution may cause a new snapshot or +// a dynamic error if the test component is blocked. + +module NegSem_200501_the_default_mechanism_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:2) { // no match + setverdict(pass, "First default"); + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:1) { // no match + setverdict(fail, "Last default"); + } + } + + testcase TC_NegSem_200501_the_default_mechanism_001() runs on GeneralComp { + activate(a1()); + activate(a2()); + p.send(integer:5); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } // defaults are terminated unsuccessfully -> dynamic test case error + } + + control{ + execute(TC_NegSem_200501_the_default_mechanism_001(), 1.0); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8ad75bcffa6aade4d4de8bf88cb9983ce8258bc --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_001.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that activated default is invoked + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +module Sem_200501_the_default_mechanism_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_Sem_200501_the_default_mechanism_001() runs on GeneralComp { + activate(a()); + p.send(integer:5); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_001()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2bea9acfd10c96ff11dd3b92077ef40a56ab0a3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_002.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that default are processed in interleave + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +// In particular, the test case is related to the NOTE 1: +// An interleave statement is semantically equivalent to a nested set of alt statements +// and the default mechanism also applies to each of these alt statements. This means, +// the default mechanism also applies to interleave statements. Furthermore, the restrictions +// imposed on interleave statements in clause 20.4 do not apply to altsteps that are +// activated as default behaviour for interleave statements. + +module Sem_200501_the_default_mechanism_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_Sem_200501_the_default_mechanism_002() runs on GeneralComp { + activate(a()); + p.send(integer:1); + p.send(integer:2); + interleave { + [] p.receive(integer:5) { // not expected: leads to default invocation + setverdict(fail); + } + [] p.receive(integer:2) { // not expected: the first default causes exit from interleave + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_002()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c0cff5005bbe4e68165a1e0008fe136fc75a431 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_003.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify than default are processed in interleave + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +// In particular, the test case is related to the NOTE 1: +// An interleave statement is semantically equivalent to a nested set of alt statements +// and the default mechanism also applies to each of these alt statements. This means, +// the default mechanism also applies to interleave statements. Furthermore, the restrictions +// imposed on interleave statements in clause 20.4 do not apply to altsteps that are +// activated as default behaviour for interleave statements. + +module Sem_200501_the_default_mechanism_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_Sem_200501_the_default_mechanism_003() runs on GeneralComp { + activate(a()); + p.send(integer:1); + p.send(integer:2); + interleave { + [] p.receive(integer:1) { // expected, no default in this case + setverdict(pass); + } + [] p.receive(integer:3) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_003()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4c16b3de0ab4e247ed2b3f296d43ad406db51c9a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_004.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that default processing order is correct + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each test component the defaults, i.e. activated altsteps, are stored as an ordered +// list. The defaults are listed in the reversed order of their activation i.e. the last +// activated default is the first element in the list of active defaults. + +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +// In the case of a successful termination, the default ... the main control flow of the +// test component will continue immediately after the alt statement from which the default +// mechanism was called... + +// Note: +// In this test case, two altsteps are activated as defaults. The sooner activated +// default leads to a test case failure, but because the last activated default takes +// precedence, it should never happen. + +module Sem_200501_the_default_mechanism_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(fail, "First default"); + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass, "Last default"); + } + } + + testcase TC_Sem_200501_the_default_mechanism_004() runs on GeneralComp { + activate(a1()); + activate(a2()); + p.send(integer:5); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_004()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7973c8a8eb47d917b7e65e7f2f07e96fe94996c3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_005.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that default processing order is correct + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For each test component the defaults, i.e. activated altsteps, are stored as an ordered +// list. The defaults are listed in the reversed order of their activation i.e. the last +// activated default is the first element in the list of active defaults. + +// The default mechanism is evoked at the end of each alt statement, if due to the +// actual snapshot none of the specified alternatives could be executed. An evoked +// default mechanism invokes the first altstep in the list of defaults, i.e. the last +// activated default, and waits for the result of its termination. The termination can +// be successful or unsuccessful. + +// In the case of an unsuccessful termination, the default mechanism invokes the next +// default in the list. + +// In the case of a successful termination, the default ... the main control flow of the +// test component will continue immediately after the alt statement from which the default +// mechanism was called... + +// Note: +// In this test case, two altsteps are activated as defaults. The last activated doesn't +// match, which should lead to invokation of the default activated as the first one. + +module Sem_200501_the_default_mechanism_005 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass, "First default"); + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:1) { // no match + setverdict(fail, "Last default"); + } + } + + testcase TC_Sem_200501_the_default_mechanism_005() runs on GeneralComp { + activate(a1()); + activate(a2()); + p.send(integer:5); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_005()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd516ecdca226495510e48f03c85a8595abc3bca --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_006.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify repeat command behaviour in invoked default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In the case of a successful termination, ... the test component will take new +// snapshot and re-evaluate the alt statement. The latter has to be specified by +// means of a repeat statement. + +module Sem_200501_the_default_mechanism_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + var integer vc_messageCounter := 0; + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + vc_messageCounter := vc_messageCounter + 1; + setverdict(pass, "Default value -> repeating alt"); + repeat; + } + } + + testcase TC_Sem_200501_the_default_mechanism_006() runs on GeneralComp { + activate(a()); + p.send(integer:5); + p.send(integer:1); + alt { + [] p.receive(integer:1) { + vc_messageCounter := vc_messageCounter + 1; + setverdict(pass); + } + } + if (vc_messageCounter != 2) { + setverdict(fail, "Different number of received messages (", vc_messageCounter, ") than expected (2)"); + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_006()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_007.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ca741e648279b9bcb440a2f3902cb41324e0020 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_007.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify break command behaviour in invoked default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the execution of the selected top alternative of the default ends with a break statement +// the control flow of the test component will continue immediately after the alt statement. + +module Sem_200501_the_default_mechanism_007 { + + type port P message { + inout integer; + } + + type component GeneralComp { + var integer vc_messageCounter := 0; + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + vc_messageCounter := vc_messageCounter + 1; + if (vc_messageCounter == 2) { + setverdict(pass, "Message count full, terminating alt"); + break; + } + setverdict(pass, "Default value -> repeating alt"); + repeat; + } + } + + testcase TC_Sem_200501_the_default_mechanism_007() runs on GeneralComp { + activate(a()); + p.send(integer:5); + p.send(integer:0); + p.send(integer:1); + alt { + [] p.receive(integer:1) { // not expected: break should occur first + vc_messageCounter := vc_messageCounter + 1; + setverdict(fail); + } + } + if (vc_messageCounter != 2) { + setverdict(fail, "Different number of received messages (", vc_messageCounter, ") than expected (2)"); + } + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_007()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_008.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b02ad561d6d337c59a942923ccf6baba578406d3 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200501_the_default_mechanism/Sem_200501_the_default_mechanism_008.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify stop command behaviour in invoked default + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// In the case of a successful termination, the default may either stop the test component +// by means of a stop statement + +module Sem_200501_the_default_mechanism_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass, "Default value -> stopping component"); + stop; + } + } + + testcase TC_Sem_200501_the_default_mechanism_008() runs on GeneralComp { + activate(a()); + p.send(integer:5); + alt { + [] p.receive(integer:1) { // not expected: invoking default + setverdict(fail); + } + } + setverdict(fail, "Component stop expected"); + } + + control{ + execute(TC_Sem_200501_the_default_mechanism_008()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cbc2f4ba045888b5cc01af1efffeeb8d5ae420d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify error is generated if activated alstep runs on incompatible component + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An activate operation will put the referenced altstep as the first element into the list +// of defaults and return a default reference. +// The effect of an activate operation is local to the test component in which it is called. + +module NegSem_200502_the_activate_operation_001 { + + type component GeneralComp { + } + + type port P message { + inout integer; + } + + type component TestComp { + port P p; + } + + altstep a() runs on TestComp { + [] p.receive {} + } + + testcase TC_NegSem_200502_the_activate_operation_001() runs on GeneralComp { + activate(a()); + setverdict(pass); + } + + control{ + execute(TC_NegSem_200502_the_activate_operation_001()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f7e43d85c789461598b52a2e1d7f9144026ce02 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify error is generated when passing local timer + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// All timer instances in the actual parameter list shall be declared as component type local timers. + +module NegSem_200502_the_activate_operation_002 { + + type component GeneralComp { + } + + altstep a(timer t_tmr) runs on GeneralComp { + [] t_tmr.timeout {} + } + + testcase TC_NegSem_200502_the_activate_operation_002() runs on GeneralComp { + if (true) { + timer t_local := 0.5; + t_local.start; + activate(a(t_local)); + } + any port.receive; + setverdict(pass); + } + + control{ + execute(TC_NegSem_200502_the_activate_operation_002()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bc70575a86c59f423ae5eef50f9cd2405514812 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_003.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify error is generated when activating altstep with out parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An altstep that is activated as a default shall only have in parameters, port parameters, or timer parameters. + +module NegSem_200502_the_activate_operation_003 { + + type component GeneralComp { + } + + altstep a(out integer p_val) runs on GeneralComp { + [] any port.receive {} + } + + testcase TC_NegSem_200502_the_activate_operation_003() runs on GeneralComp { + var integer v_val; + activate(a(v_val)); + } + + control{ + execute(TC_NegSem_200502_the_activate_operation_003()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a610d3a5b8bb30d6bc08bb185d637431b3434cc2 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify error is generated when activating altstep with inout parameters + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An altstep that is activated as a default shall only have in parameters, port parameters, or timer parameters. + +module NegSem_200502_the_activate_operation_004 { + + type component GeneralComp { + } + + altstep a(inout integer p_val) runs on GeneralComp { + [] any port.receive {} + } + + testcase TC_NegSem_200502_the_activate_operation_004() runs on GeneralComp { + var integer v_val := 1; + activate(a(v_val)); + } + + control{ + execute(TC_NegSem_200502_the_activate_operation_004()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fde6514b439eefaf2b2644c309c7158f611eb70 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_005.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify error is generated when activating function + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// An activate operation will put the referenced altstep as the first element into the list of defaults +// and return a default reference. + +module NegSem_200502_the_activate_operation_005 { + + type component GeneralComp { + } + + function f() runs on GeneralComp { + alt { + [] any port.receive {} + } + } + + testcase TC_NegSem_200502_the_activate_operation_005() runs on GeneralComp { + activate(f()); + setverdict(pass); + } + + control{ + execute(TC_NegSem_200502_the_activate_operation_005()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e7ae3192d013af110198037fe0a84a8af4fdff9 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_006.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.5.2, local timer as a parameter of activated altstep in module control + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. + +module NegSem_200502_the_activate_operation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_NegSem_200502_the_activate_operation_006() runs on GeneralComp { + setverdict(pass); + } + + function f_test() { + timer t_tmr := 1.0, t_tmr2; + t_tmr.start; + activate(a(t_tmr)); + alt { + [] t_tmr2.timeout { } + } + } + + control{ + f_test(); + execute(TC_NegSem_200502_the_activate_operation_006()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_007.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61efe063768417a0b3648ee03751288bad012218 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/NegSem_200502_the_activate_operation_007.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.5.2, local timer (referenced through timer parameter) as a parameter of activated altstep in module control + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. + +module NegSem_200502_the_activate_operation_007 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_NegSem_200502_the_activate_operation_007() runs on GeneralComp { + setverdict(pass); + } + + function f_activate(timer t_tmr) { + activate(a(t_tmr)); + } + + function f_test() { + timer t_tmr := 1.0; + t_tmr.start; + f_activate(t_tmr); // t_tmr is a local timer, this should lead to an activation error in f_activate + } + + control{ + timer t_tmr2; + f_test(); + alt { + [] t_tmr2.timeout { } + } + execute(TC_NegSem_200502_the_activate_operation_007()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68591ee41d8963327721241ebeb93b8d2760ab7c --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify that activate operation can be used as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The activate operation can be called without saving the returned default reference. +// This form is useful in test cases which do not require explicit deactivation +// of the activated default, i.e. deactivation of a default is done implicitly at +// MTC termination. + +// Note: +// An activate operation saving the returned default reference is tested in the section +// 6.2.8. + +module Sem_200502_the_activate_operation_001 { + + type component GeneralComp { + } + + altstep a() runs on GeneralComp + { + [] any port.receive {} + } + + testcase TC_Sem_200502_the_activate_operation_001() runs on GeneralComp { + activate(a()); + setverdict(pass); + } + + control{ + execute(TC_Sem_200502_the_activate_operation_001()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2eb7a2725dd5c985845e0dbc7a9c62f1cb88ee6c --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_002.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify that parameters are passed at activation time + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// The actual parameters of a parameterized altstep (see clause 16.2.1) that should +// be activated as a default, shall be provided in the corresponding activate statement. +// This means the actual parameters are bound to the default at the time of its activation +// (and not e.g. at the time of its invocation by the default mechanism). + +module Sem_200502_the_activate_operation_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + const integer c_defaultParValue := 1; + + altstep a(integer p_par) runs on GeneralComp { + [] p.receive(integer:?) { + if (p_par == c_defaultParValue) { setverdict(pass); } + else { setverdict(fail); } + } + } + + testcase TC_Sem_200502_the_activate_operation_002() runs on GeneralComp { + var integer v_num := c_defaultParValue; + activate(a(v_num)); + v_num := v_num + 1; + p.send(integer:5); + alt { + [] p.receive(integer:0) { // not expected: leads to default evocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200502_the_activate_operation_002()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88d8015bce32cd19e700d603b8f1294d4648edea --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_003.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify that passing component timer to activated altstep + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// All timer instances in the actual parameter list shall be declared as component type local timers. + +module Sem_200502_the_activate_operation_003 { + + type component GeneralComp { + timer tc_tmr := 0.5; + } + + altstep a(timer t_tmr) runs on GeneralComp { + [] t_tmr.timeout {} + } + + testcase TC_Sem_200502_the_activate_operation_003() runs on GeneralComp { + tc_tmr.start; + activate(a(tc_tmr)); + any port.receive; + setverdict(pass); + } + + control{ + execute(TC_Sem_200502_the_activate_operation_003()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03f3bf1373d3e203ed236c13b549947f07edfc3a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_004.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.2, verify passing port parameter to activated altstep + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// An altstep that is activated as a default shall only have in parameters, port parameters, or timer parameters. + +module Sem_200502_the_activate_operation_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(P p_port) runs on GeneralComp { + [] p_port.receive(integer:?) { setverdict(pass); } + } + + testcase TC_Sem_200502_the_activate_operation_004() runs on GeneralComp { + activate(a(p)); + p.send(integer:1); + alt { + [] p.receive(integer:0) { setverdict(fail); } + } + } + + control{ + execute(TC_Sem_200502_the_activate_operation_004()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ea9034e7520f8ab286c09ca4ab8ac3cad4ca26a --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_005.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.5.2, control block timer as a parameter of activated altstep + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. + +module Sem_200502_the_activate_operation_005 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_Sem_200502_the_activate_operation_005() runs on GeneralComp { + setverdict(pass); + } + + control{ + timer t_tmr := 1.0, t_tmr2; + t_tmr.start; + activate(a(t_tmr)); + alt { + [] t_tmr2.timeout { } + } + execute(TC_Sem_200502_the_activate_operation_005()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_006.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8dfaa5cab03d712cfac85933fe91c52bae9f9721 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200502_the_activate_operation/Sem_200502_the_activate_operation_006.ttcn @@ -0,0 +1,48 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:20.5.2, control block timer (referenced through timer parameter) as a parameter of activated altstep + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// For altsteps activated in module control or in functions or altsteps invoked +// directly or indirectly from module control, all timer instances in the actual +// parameter list shall be declared in the highest scope of the module control +// part (see clause 26.2). Timers from lower scopes of the module control part +// (i.e. from the nested statement blocks) are not allowed to occur in the actual +// parameter list. + +module Sem_200502_the_activate_operation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a(timer t_tmr) { + [] t_tmr.timeout { log ("Timeout in default"); } + } + + testcase TC_Sem_200502_the_activate_operation_006() runs on GeneralComp { + setverdict(pass); + } + + function f_test(timer t_tmr) { + //timer t_tmr2; + t_tmr.start; + activate(a(t_tmr)); + alt { + [] t_tmr.timeout { } + } + } + + control{ + timer t_tmr := 1.0; + f_test(t_tmr); + execute(TC_Sem_200502_the_activate_operation_006()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..730023d46a85ea54495ffd1d74c1dbff2b74fc17 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_001.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate deactivated default causes error + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Calling a deactivate operation with an undefined default reference, e.g. an old reference +// to a default that has already been deactivated, shall cause a runtime error. + +module NegSem_200503_the_deactivate_operation_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_NegSem_200503_the_deactivate_operation_001() runs on GeneralComp { + var default v_default := activate(a1()); + p.send(integer:1); + deactivate(v_default); // correct deactivation + deactivate(v_default); // v_default is deactivated at this point -> runtime error + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_NegSem_200503_the_deactivate_operation_001(), 1.0); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6383993bd857128456f1bdea1a8646d081304414 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_002.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate uninitialized default causes error + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Calling a deactivate operation with an uninitialized default reference variable +// shall cause a runtime error. + +module NegSem_200503_the_deactivate_operation_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + + testcase TC_NegSem_200503_the_deactivate_operation_002() runs on GeneralComp { + var default v_default; + var boolean v_flag := false; + if (v_flag) { + v_default := activate(a1()); + } + p.send(integer:1); + deactivate(v_default); // uninitialized -> runtime error + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_NegSem_200503_the_deactivate_operation_002(), 1.0); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f78d590510127f78320e85dd6ef05dc58f9d23a0 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/NegSem_200503_the_deactivate_operation_003.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that error is generated when deactivated reference is on incorrect type + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// A deactivate operation will remove the referenced default from the list of defaults. + +module NegSem_200503_the_deactivate_operation_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_NegSem_200503_the_deactivate_operation_003() runs on GeneralComp { + var GeneralComp v_ptc := null; + p.send(integer:1); + deactivate(v_ptc); // incorrect type -> error + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_NegSem_200503_the_deactivate_operation_003()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7a3b1dd3dff751e2d083421d143858295e85d99 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_001.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate removes default from list of defaults + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// A deactivate operation will remove the referenced default from the list of defaults. + +module Sem_200503_the_deactivate_operation_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(fail, "Deactivated"); // should be deactivated at the time of default processing + } + } + + testcase TC_Sem_200503_the_deactivate_operation_001() runs on GeneralComp { + var default v_default; + activate(a1()); + v_default := activate(a2()); + p.send(integer:1); + deactivate(v_default); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200503_the_deactivate_operation_001()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f552f370d686c5b798167cc096fbeeed93c5b50 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_002.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate removes default from list of defaults + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// A deactivate operation will remove the referenced default from the list of defaults. + +// Note: +// The test verifies syntactical variant with a function instance passed as a parameter +// to the deactivate operation. + +module Sem_200503_the_deactivate_operation_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(fail, "Deactivated"); // should be deactivated at the time of default processing + } + } + + function f(default p_default) return default { + return p_default; + } + + testcase TC_Sem_200503_the_deactivate_operation_002() runs on GeneralComp { + var default v_default; + activate(a1()); + v_default := activate(a2()); + p.send(integer:1); + deactivate(f(v_default)); + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200503_the_deactivate_operation_002()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b0bd724842422f93301b195eb8e540f238312b7 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_003.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate without parameter clear list of defaults + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// A deactivate operation without parameter deactivates all defaults of a test component. + +module Sem_200503_the_deactivate_operation_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:1) { + setverdict(fail, "Deactivated"); // should be deactivated at the time of default processing + } + } + + altstep a2() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(fail, "Deactivated"); // should be deactivated at the time of default processing + } + } + + testcase TC_Sem_200503_the_deactivate_operation_003() runs on GeneralComp { + timer t := 0.5; + t.start; + activate(a1()); + activate(a2()); + p.send(integer:1); + deactivate; + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + [] t.timeout { // timer should provide enough time to take at least one snapshot + setverdict(pass); + } + } + } + + control{ + execute(TC_Sem_200503_the_deactivate_operation_003()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac857c772c4199c9e30f0d3b16bbbde17cb7c132 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/2005_default_handling/200503_the_deactivate_operation/Sem_200503_the_deactivate_operation_004.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:20.5.1, verify that deactivate null works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Calling a deactivate operation with the special value null has no effect. + +module Sem_200503_the_deactivate_operation_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a1() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_Sem_200503_the_deactivate_operation_004() runs on GeneralComp { + var default v_default := null; + activate(a1()); + p.send(integer:1); + deactivate(v_default); // v_default is null: there should be no error and no deactivation + alt { + [] p.receive(integer:0) { // not expected: leads to default invocation + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_200503_the_deactivate_operation_004()); + } +} diff --git a/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_001.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71e8b7d1d700d9ea51e593172342c00712b81584 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20, Ensure that alt-statements are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_20_TopLevel_001 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_test := "ping"; + +testcase TC_Syn_20_TopLevel_001() runs on GeneralComp { + var boolean guard := false; + p.send(m_test); + alt { + [] p.receive(m_test) { + setverdict(pass); + } + [guard == true] p.receive(m_test) { + setverdict(fail); + } + [else] { + setverdict(fail); + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_002.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..257113bf7af4883621f466fd158a5cb64c2d9476 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20, Ensure that repeat in an alt-statement is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_20_TopLevel_002 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_test := "ping"; + +testcase TC_Syn_20_TopLevel_002() runs on GeneralComp { + var integer counter := 1; + p.send(m_test); + alt { + [counter == 1] p.receive(m_test) { + counter := counter + 1; + repeat; + } + [else] { + setverdict(pass); + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_003.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..580272945ee26220283c58fd976efdd8f491c146 --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_003.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20, Ensure that the interleave-statement is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_20_TopLevel_003 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +testcase TC_Syn_20_TopLevel_003() runs on GeneralComp { + p.send(m_testOne); + p.send(m_testTwo); + interleave { + [] p.receive(m_testOne) { + } + [] p.receive(m_testTwo) { + } + } + setverdict(pass); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_004.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91218ec30d4a23aac911b19fbbadb0f4c636667d --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_004.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20, Ensure that defaults and the activate statement is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_20_TopLevel_004 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +altstep a_catchError() runs on GeneralComp { + [] any port.receive { + } +} + +testcase TC_Syn_20_TopLevel_004() runs on GeneralComp { + var default v_errorDefault := activate(a_catchError()); + p.send(m_testOne); + alt { + [] p.receive(m_testOne) { + } + } + setverdict(pass); +} + +} \ No newline at end of file diff --git a/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_005.ttcn b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f0341eb60eb01f3ab5ab174af2d6ec34139901e --- /dev/null +++ b/ATS/core_language/20_statement_and_operations_for_alt/20_toplevel/Syn_20_TopLevel_005.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:20, Ensure that defaults and the activate statement is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_20_TopLevel_005 { + +type port MyPort message { + inout charstring +} + +type component GeneralComp { + port MyPort p; +} + +template charstring m_testOne := "ping1"; +template charstring m_testTwo := "ping2"; + +altstep a_catchError() runs on GeneralComp { + [] any port.receive { + } +} + +testcase TC_Syn_20_TopLevel_005() runs on GeneralComp { + var default v_errorDefault := activate(a_catchError()); + p.send(m_testOne); + alt { + [] p.receive(m_testOne) { + } + } + deactivate(v_errorDefault); + setverdict(pass); +} + +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NOTES b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..f49c96ae79a6bbc9673a318bf986fd38f2959065 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NOTES @@ -0,0 +1 @@ +More connect and map test are given in section 9.1 \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..484693f8734da00d58f3bfb2ccd1af57a342dbdb --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_001.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that connect operation rejects ports with incompatible message type lists + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, inlists and outlists are completely incompatible + +module NegSem_210101_connect_and_map_operations_001 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + in R; + } + + type port P2 message { + out bitstring; + in boolean; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + testcase TC_NegSem_210101_connect_and_map_operations_001() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + connect(v_ptc1:p, v_ptc2:p); // incompatible message types: error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_001()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a9dd4da6311f248ec9a4a9771a88a153489448c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_002.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that connect operation rejects ports with only partially compatible message type lists + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, one pair in outlist-PORT1 and inlist-PORT2 is incompatible (using +// strong typing rules) + +module NegSem_210101_connect_and_map_operations_002 { + type record R { + integer field1, + charstring field2 + } + + type record R2 { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R; + } + + type port P2 message { + in R2, integer; + out integer; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + testcase TC_NegSem_210101_connect_and_map_operations_002() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + // R2 and R are compatible types, but strong typing is required in case of connection operation + connect(v_ptc1:p, v_ptc2:p); // incompatible message types: error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_002()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_003.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2481f7b90f050f74eefe04605cd75548a9135147 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_003.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that map operation rejects ports with incompatible message type lists + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, inlists and outlists are completely incompatible + +module NegSem_210101_connect_and_map_operations_003 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R; + } + + type port P2 message { + out boolean; + in bitstring; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_NegSem_210101_connect_and_map_operations_003() runs on GeneralComp system SystemComp { + map(system:p, self:p); // incompatible message types: error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_003()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_004.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ecd7452229c6cc0c2f51df46ef4eeb4c67ce038 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_004.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that connect operation rejects ports with only partially compatible message type lists + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, one pair in outlist-PORT1 and inlist-PORT2 is incompatible (using +// strong typing rules) + +module NegSem_210101_connect_and_map_operations_004 { + type record R { + integer field1, + charstring field2 + } + + type record R2 { + integer field1, + charstring field2 + } + + type port P1 message { + in integer; + inout R; + } + + type port P2 message { + in integer, R; + out R2; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_NegSem_210101_connect_and_map_operations_004() runs on GeneralComp system SystemComp { + // R2 and R are compatible types, but strong typing is required in case of connection operation + map(system:p, self:p); // incompatible message types: error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_004()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_005.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83bc4b2994f1fbb63698a8292d5f7d43a663bfc8 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_005.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that map parameters cannot be used when not declared in the port type + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction g: +// If in a map operation a param clause is present, the actual parameters shall conform +// to the map param clause of the port type declaration of the system port used. + +module NegSem_210101_connect_and_map_operations_005 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210101_connect_and_map_operations_005() runs on GeneralComp system GeneralComp { + map(system:p, self:p) param(5); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_006.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9476d376a567c7ae3fed44fea0698970e889c3d9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_006.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that type incompatibility in map parameters is detected + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction g: +// If in a map operation a param clause is present, the actual parameters shall conform +// to the map param clause of the port type declaration of the system port used. + +module NegSem_210101_connect_and_map_operations_006 { + + type port P message { + inout integer; + map param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210101_connect_and_map_operations_006() runs on GeneralComp system GeneralComp { + map(system:p, self:p) param("5"); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_007.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a82f2b10369b59d6b60a29c0a7c2f4671bf5c45d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_007.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that parameter count mismatch in map param clause is detected + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction g: +// If in a map operation a param clause is present, the actual parameters shall conform +// to the map param clause of the port type declaration of the system port used. + +module NegSem_210101_connect_and_map_operations_007 { + + type port P message { + inout integer; + map param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210101_connect_and_map_operations_007() runs on GeneralComp system GeneralComp { + map(system:p, self:p) param(5, 3); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_007()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_008.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8b6c5713f0c53c16f5403d9db946fd7e11f69e5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_008.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for local ports in connect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_connect() runs on GeneralComp { + connect(self:p, self:p2); // although the actual instance of self contains the p2 port, + // it cannot be referenced as the "runs on" clause contains the GeneralComp type and + // not GeneralCompEx + } + + testcase TC_NegSem_210101_connect_and_map_operations_008() runs on GeneralCompEx system GeneralComp { + f_connect(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_008()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_009.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32ed46be6cc7d69a7cc4feebacd76c7350d96733 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_009.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for MTC ports in connect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_connect() runs on GeneralCompEx mtc GeneralComp { + connect(mtc:p2, self:p); // although the actual instance of MTC contains the p2 port, + // it cannot be referenced as the mtc clause of the f_connect function contains + // the GeneralComp type and not GeneralCompEx + } + + testcase TC_NegSem_210101_connect_and_map_operations_009() runs on GeneralCompEx system GeneralComp { + f_connect(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_009()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_010.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db4e97f67f14131070b9b9a71fb3509dae7b0734 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_010.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for PTC ports in connect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_010 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + testcase TC_NegSem_210101_connect_and_map_operations_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralCompEx.create; + connect(self:p, v_ptc:p2); // although the actual PTC instance contains the p2 port, + // it cannot be referenced as the variable v_ptc is of the GeneralComp type and + // not GeneralCompEx + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_010()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_011.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f273a5b8b463b7638d7b39819cdd41ece7ee4804 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_011.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for local ports in map operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_011 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_map() runs on GeneralComp system GeneralComp { + map(system:p, self:p2); // although the actual instance of self contains the p2 port, + // it cannot be referenced as the "runs on" clause contains the GeneralComp type and + // not GeneralCompEx + } + + testcase TC_NegSem_210101_connect_and_map_operations_011() runs on GeneralCompEx system GeneralComp { + f_map(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_011()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_012.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..945ed584d493fdb27aae90b10193a4b0c94908b5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_012.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for MTC ports in map operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_012 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_map() runs on GeneralCompEx mtc GeneralComp system GeneralComp { + map(mtc:p2, system:p); // although the actual instance of MTC contains the p2 port, + // it cannot be referenced as the mtc clause of the f_connect function contains + // the GeneralComp type and not GeneralCompEx + } + + testcase TC_NegSem_210101_connect_and_map_operations_012() runs on GeneralCompEx system GeneralComp { + f_map(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_012()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_013.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0df7183b1c78b7a8acba4cecb557ba91a9610075 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_013.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for PTC ports in map operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_013 { + + type port P message { + inout integer; + map param (integer p_par1); + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + testcase TC_NegSem_210101_connect_and_map_operations_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralCompEx.create; + map(system:p, v_ptc:p2); // although the actual PTC instance contains the p2 port, + // it cannot be referenced as the variable v_ptc is of the GeneralComp type and + // not GeneralCompEx + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_013()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_014.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac0c444a838e565fff50841d7f1d002415c85855 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_and_map_operations_014.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.1, violation of strong typing rules for system ports in map operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined in the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210101_connect_and_map_operations_014 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_map() runs on GeneralComp system GeneralComp { + map(self:p, system:p2); // although the actual instance of TSI contains the p2 port, + // it cannot be referenced as the system clause of the f_map function contains + // the GeneralComp type and not GeneralCompEx + } + + testcase TC_NegSem_210101_connect_and_map_operations_014() runs on GeneralComp system GeneralCompEx { + f_map(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_connect_and_map_operations_014()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32371298883de36499c07ea2bee25ab77d24cef1 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_connect_operation_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Ensure that the the IUT does not allows two output port connection + ** @verdict pass reject + ***************************************************/ +//Test the two output port cannot connect +module NegSem_210101_connect_operation_001{ + + type port myport message { + out integer + } + + +type component Mysystem + { + port myport messagePort; + } + +testcase TC_NegSem_210101_connect_operation_001() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + var Mysystem MyCompB; + +MyCompA:=Mysystem.create; +MyCompB:=Mysystem.create; +connect(MyCompA:messagePort,MyCompB:messagePort); //not allowed messageports are output + +} +control{ + execute(TC_NegSem_210101_connect_operation_001()); +} +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_map_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_map_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba90504a117f013cb9ce21f7027fdaf003708fe7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/NegSem_210101_map_operation_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.1.1, Ensure that IUT cannot map input port with output port + ** @verdict pass reject + ***************************************************/ + +// Mycompport A P1 is output port mapped to SUT in port +module NegSem_210101_map_operation_002{ + + type port loopbackPort message { + inout integer + } +type port IntegerOutputPortType message { + out integer + } + +type component GeneralComp + { + + port IntegerOutputPortType MycomportA + } + +type component MyTestSystemInterface + { + port loopbackPort messagePort + } +// MyTestSystemInterface is the test system interface +testcase TC_NegSem_210101_map_operation_002() runs on GeneralComp system MyTestSystemInterface { +// establishing the port connections +map(mtc:MycomportA, system:messagePort); //not allowed: MycomportA is out port, meanwhile MySysteminterface port is input + +} +control{ + execute(TC_NegSem_210101_map_operation_002()); +} +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6223dab690a0445c07fb155869e208431153a890 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Connect operation accepts ports with compatible message type list containing several types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 == inlist-PORT2 and outlist-PORT2 == inlist-PORT1 + +module Sem_210101_connect_and_map_operations_001 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R, charstring; + } + + type port P2 message { + in charstring, R, integer; + out integer; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + function f1() runs on C1 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + function f2() runs on C2 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + testcase TC_Sem_210101_connect_and_map_operations_001() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + connect(v_ptc1:p, v_ptc2:p); // compatible, 1:1 mapping + v_ptc1.start(f1()); + v_ptc2.start(f2()); + all component.done; + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_001()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef894c6120cee561af5c62fe4484d6d778cfc865 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Connect operation accepts ports where outlist of the 1st port is a subset of inlist of the 2nd port + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 ⊂ inlist-PORT2 and outlist-PORT2 == inlist-PORT1 + +module Sem_210101_connect_and_map_operations_002 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R; + } + + type port P2 message { + in charstring, boolean, R, integer; + out integer; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + function f1() runs on C1 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + function f2() runs on C2 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + + testcase TC_Sem_210101_connect_and_map_operations_002() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + // v_ptc1:p outlist is (integer, R) and v_ptc2:p inlist is (charstring, boolean, R, integer) + connect(v_ptc1:p, v_ptc2:p); + v_ptc1.start(f1()); + v_ptc2.start(f2()); + all component.done; + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_002()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_003.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5effe5568c50af9a5516dc83252e09f55a01b1b0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_003.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Connect operation accepts ports where outlist of the 2nd port is a subset of inlist of the 1st port + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 == inlist-PORT2 and outlist-PORT2 ⊂ inlist-PORT1 + +module Sem_210101_connect_and_map_operations_003 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R; + } + + type port P2 message { + in charstring, boolean, R, integer; + out integer; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + function f1() runs on C1 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + function f2() runs on C2 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + + testcase TC_Sem_210101_connect_and_map_operations_003() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + // v_ptc2:p inlist is (charstring, boolean, R, integer) and v_ptc1:p outlist is (integer, R) + connect(v_ptc2:p, v_ptc1:p); + v_ptc1.start(f1()); + v_ptc2.start(f2()); + all component.done; + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_003()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_004.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02f487cecc86691ddc32970557f78d5ecb6343e9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_004.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Connect operation accepts ports where outlist of both ports are subsets of inlist of the counterpart ports + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// b) The connect operation is allowed if and only if: +// outlist-PORT1 ⊆ inlist-PORT2 and outlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 ⊂inlist-PORT2 and outlist-PORT2 ⊂ inlist-PORT1 + +module Sem_210101_connect_and_map_operations_004 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer, R; + in bitstring; + } + + type port P2 message { + in charstring, boolean, R, integer; + out integer; + } + + type component GeneralComp { + } + + type component C1 { + port P1 p; + } + + type component C2 { + port P2 p; + } + + function f1() runs on C1 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + function f2() runs on C2 + { + timer t := 1.0; + t.start; + if(p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + testcase TC_Sem_210101_connect_and_map_operations_004() runs on GeneralComp system GeneralComp { + var C1 v_ptc1 := C1.create; + var C2 v_ptc2 := C2.create; + // v_ptc1:p outlist is (integer, R) and v_ptc2:p inlist is (charstring, boolean, R, integer) + // v_ptc2:p outlist is (integer) and v_ptc2:p inlist is (R, integer, bitstring) + connect(v_ptc1:p, v_ptc2:p); + v_ptc1.start(f1()); + v_ptc2.start(f2()); + all component.done; + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_004()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_005.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5638c7708a16479e5b2df4e4f8bba28c93173e0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_005.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Map operation accepts ports with compatible message type list containing several types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 == outlist-PORT2 and inlist-PORT2 == inlist-PORT1 + +module Sem_210101_connect_and_map_operations_005 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R, charstring; + } + + type port P2 message { + out charstring, R, integer; + in integer; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_Sem_210101_connect_and_map_operations_005() runs on GeneralComp system SystemComp { + map(self:p, system:p); // compatible, 1:1 mapping + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_006.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..019c214646237e98dc28da13a4e7076d45496611 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_006.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Map operation accepts ports with compatible message type list containing several types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 ⊂ outlist-PORT2 and inlist-PORT2 == inlist-PORT1 + +module Sem_210101_connect_and_map_operations_006 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + inout integer; + out R; + } + + type port P2 message { + out charstring, R, integer, bitstring; + in integer; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_Sem_210101_connect_and_map_operations_006() runs on GeneralComp system SystemComp { + // self:p outlist is (integer, R) and system:p outlist is (charstring, boolean, R, integer) + map(self:p, system:p); + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_007.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e48f1296f0fbbf0dd52d71b0bac89b592f965f62 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_007.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Map operation accepts ports with compatible message type list containing several types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 == outlist-PORT2 and inlist-PORT2 ⊂ inlist-PORT1 + +module Sem_210101_connect_and_map_operations_007 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + in charstring, bitstring; + inout integer; + out R; + } + + type port P2 message { + out R, integer; + in integer; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_Sem_210101_connect_and_map_operations_007() runs on GeneralComp system SystemComp { + // self:p inlist is (integer, charstring, bitstring) and system:p inlist is (integer) + map(system:p, self:p); + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_007()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_008.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27f6143ad39013ca3502e739bf11e175003ccdaf --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_008.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Map operation accepts ports with compatible message type list containing several types + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// For the connect operations, only consistent connections are allowed. +// a) Assuming the following: +// 1) ports PORT1 and PORT2 are the ports to be connected; +// 2) inlist-PORT1 defines the messages or procedures of the in-direction of PORT1; +// 3) outlist-PORT1defines the messages or procedures of the out-direction of PORT1; +// 4) inlist-PORT2 defines the messages or procedures of the in-direction of PORT2; and +// 5) outlist-PORT2 defines the messages or procedures of the out-direction of PORT2. +// c) The map operation (assuming PORT2 is the test system interface port) is allowed if +// and only if: +// outlist-PORT1 ⊆ outlist-PORT2 and inlist-PORT2 ⊆ inlist-PORT1. +// +// In this test, outlist-PORT1 ⊂ outlist-PORT2 and inlist-PORT2 ⊂ inlist-PORT1 + +module Sem_210101_connect_and_map_operations_008 { + type record R { + integer field1, + charstring field2 + } + + type port P1 message { + in charstring, bitstring; + inout integer; + out R; + } + + type port P2 message { + out R, integer, boolean; + in integer; + } + + type component GeneralComp { + port P1 p + } + + type component SystemComp { + port P2 p; + } + + testcase TC_Sem_210101_connect_and_map_operations_008() runs on GeneralComp system SystemComp { + // self:p inlist is (integer, charstring, bitstring) and system:p inlist is (integer) + // self:p outlist is (integer, R) and system:p outlist is (integer, R, boolean) + map(system:p, self:p); + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_008()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_009.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..faa8c44a196812c3a23e243b5a88cad8a3fe418a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_009.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 433, STF 470 + ** @version 0.0.2 + ** @purpose 1:21.1.1, Ensure that map param statements are allowed in testcase block + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210101_connect_and_map_operations_009 { + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType1 { + integer field1, + charstring field2, + boolean field3 + } + + type port MyMessagePortType message { + inout integer; + map param (in MyMessageType1 p1, inout charstring p2); + } + + const MyMessageType1 c_myTemplate1 := { + field1 := 2, + field2 := "foobar", + field3 := true + } + + testcase TC_Sem_210101_connect_and_map_operations_009() runs on GeneralComp system GeneralComp { + var charstring v_varString := "foobar"; + + map(mtc:pt_myPort, system:pt_myPort) param(c_myTemplate1, v_varString); + + pt_myPort.send(13); + log("Map inout parameter: ", v_varString); + + if(pt_myPort.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + unmap(mtc:pt_myPort, system:pt_myPort); + + setverdict(pass); + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_010.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7461c6de59d11aaa4c7fc5865800f233d1706256 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_010.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.1, Verify that the param part can be skipped in map operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Restriction g: +// In map operations, param clauses are optional. + +module Sem_210101_connect_and_map_operations_010 { + + type port P message { + inout integer; + map param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_Sem_210101_connect_and_map_operations_010() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_210101_connect_and_map_operations_010()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_011.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e77b565281601e96645a4f9ccf02191215bbf7c6 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_011.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.1.1, Ensure that the the IUT allows connecting ports with empty outlists + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// NOTE: the test shall pass as empty set (in this case a list of allowed out types) is always a subset +// of another set (in this case a list of allowed in types). For that reason, the test was changed +// into a positive one as it does not violate any TTCN-3 requirement. +// Of course it doesn't make much sense to connect these two ports as communication is not possible +// between them. A CR7607 was submitted to mantis to add a new restriction to the core language standard. + +module Sem_210101_connect_and_map_operations_011 { + + type port myport message { + in integer + } + + type component Mysystem { + port myport messagePort; + } + + testcase TC_Sem_210101_connect_and_map_operations_011() runs on Mysystem system Mysystem { + var Mysystem MyCompA := Mysystem.create, + MyCompB := Mysystem.create; + connect(MyCompA:messagePort, MyCompB:messagePort); + setverdict(pass); + } + + control { + execute(TC_Sem_210101_connect_and_map_operations_011(), 5.0); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_012.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ece3db2601515f9f669054d655f3ce94c3bb53ce --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210101_connect_and_map_operations/Sem_210101_connect_and_map_operations_012.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.1 + ** @purpose 1:21.1.1, Ensure that IUT can map ports with empty outlist-PORT1 and inlist-PORT2 + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// NOTE: the test shall pass as empty set (in this case outlist-PORT1 and inlist-PORT2) is always a subset +// of another set (in this case outlist-PORT2 and inlist-PORT1). For that reason, the test was changed +// into a positive one as it does not violate any TTCN-3 requirement. +// Of course it doesn't make much sense to map these two ports as communication is not possible +// between them. A CR7607 was submitted to mantis to add a new restriction to the core language standard. + +module Sem_210101_connect_and_map_operations_012 { + + type port LoopbackPort message { + out integer + } + type port IntegerOutputPortType message { + in integer + } + + type component GeneralComp { + port IntegerOutputPortType MycomportA + } + + type component MyTestSystemInterface { + port LoopbackPort messagePort + } + + // MyTestSystemInterface is the test system interface + testcase TC_Sem_210101_connect_and_map_operations_012() runs on GeneralComp system MyTestSystemInterface { + // establishing the port connections + map(mtc:MycomportA, system:messagePort); //not allowed: MycomportA is in port, meanwhile MySysteminterface port is output + setverdict(pass); + } + + control { + execute(TC_Sem_210101_connect_and_map_operations_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de035cf70ce11b80ddb9b9b3512bdaf4a29dc7e0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_001.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that unmap operation cannot contain a system port reference + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// The disconnect and unmap operations are the opposite operations of connect and map. +// (21.1) The ports of a test component can be connected to other components or to the +// ports of the test system interface. When connecting a test component to a test system +// interface the map operation shall be used. + +module NegSem_210102_disconnect_and_unmap_operations_001 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + + connect(self:p, v_ptc:p); + unmap(self:p, v_ptc:p); // no system port reference: error expected + } + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_001()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..671e5c7b6e83d18c8274306db6c051f06f911a09 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that disconnecting all ports of all components is not possible in PTC + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// The all component keyword ... shall only be used by the MTC. + +module NegSem_210102_disconnect_and_unmap_operations_002 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp { + disconnect(all component:all port); // error: allowed in PTC only + setverdict(pass); + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + v_ptc.done; // wait for the PTC to finish + } + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_002()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_003.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8ab7ef8439ea759bdaad0e138e69341115a97ae --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_003.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that unmapping all ports of all components is not possible in PTC + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// The all component keyword ... shall only be used by the MTC. + +module NegSem_210102_disconnect_and_unmap_operations_003 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp { + unmap(all component:all port); // error: allowed in PTC only + setverdict(pass); + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + map(self:p, system:p); + map(v_ptc:p, system:p); + v_ptc.start(f()); + v_ptc.done; // wait for the PTC to finish + } + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_003()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_004.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8de452a6f2fb2b6faadb775129d3745b6dd9dfd --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that unmap parameters cannot be used when not declared in the port type + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction b: +// If in a unmap operation a param clause is present, the actual parameters shall conform +// to the unmap param clause of the port type declaration of the system port used. + +module NegSem_210102_disconnect_and_unmap_operations_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_004() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(system:p, self:p) param(5); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_004()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_005.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0569c2f1fb3779484c33c804b3cfe9878bec935e --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_005.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that type incompatibility in unmap parameters is detected + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction b: +// If in a unmap operation a param clause is present, the actual parameters shall conform +// to the unmap param clause of the port type declaration of the system port used. + +module NegSem_210102_disconnect_and_unmap_operations_005 { + + type port P message { + inout integer; + unmap param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_005() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(self:p, system:p) param("5"); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_006.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ce02f5fd28ed88cc4087ae905e297772c31b27d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_006.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that parameter count mismatch in unmap param clause is detected + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction b: +// If in a unmap operation a param clause is present, the actual parameters shall conform +// to the unmap param clause of the port type declaration of the system port used. + +module NegSem_210102_disconnect_and_unmap_operations_006 { + + type port P message { + inout integer; + unmap param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_006() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(self:p, system:p) param(5, 3); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_007.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f07a3164f0abcc3bb954ed1056b62a66370ef2df --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_007.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that the param clause cannot be used when unmap contains no system port reference + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction a: +// In an unmap operation, a param clause shall only be present if the system port to +// which the param clause belongs to is explicitly referenced. + +module NegSem_210102_disconnect_and_unmap_operations_007 { + + type port P message { + inout integer; + unmap param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_007() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(self:p) param(3); + if(not p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_007()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_008.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19f594a2e3a395a889cc0f71b3181b010596d665 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_008.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for local ports in disconnect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_disconnect() runs on GeneralComp { + disconnect(self:p, self:p2); // although the actual instance of self contains the p2 port, + // it cannot be referenced as the "runs on" clause contains the GeneralComp type and + // not GeneralCompEx + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_008() runs on GeneralCompEx system GeneralComp { + connect(self:p, self:p2); + f_disconnect(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_008()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_009.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c53eb6f6b512a4a70e99dee9286a417d6df30068 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_009.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for MTC ports in disconnect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_disconnect() runs on GeneralCompEx mtc GeneralComp { + disconnect(mtc:p2, self:p); // although the actual instance of MTC contains the p2 port, + // it cannot be referenced as the mtc clause of the f_connect function contains + // the GeneralComp type and not GeneralCompEx + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_009() runs on GeneralCompEx system GeneralComp { + connect(mtc:p2, self:p); + f_disconnect(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_009()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_010.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6dca544cbf24875d2a7b1714fadb3a97999bcc14 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_010.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for PTC ports in disconnect operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_010 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_010() runs on GeneralComp system GeneralComp { + var GeneralCompEx v_ptc := GeneralCompEx.create; + var GeneralComp v_ptcAlias := v_ptc; + connect(self:p, v_ptc:p2); + disconnect(self:p, v_ptcAlias:p2);// although the actual PTC instance contains the p2 port, + // it cannot be referenced as the variable v_ptc is of the GeneralComp type and + // not GeneralCompEx + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_010()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_011.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6ad58da4f601a066a391274018fd289cdd81a01 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_011.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for local ports in unmap operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_011 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_unmap() runs on GeneralComp system GeneralComp { + unmap(self:p2, system:p); // although the actual instance of self contains the p2 port, + // it cannot be referenced as the "runs on" clause contains the GeneralComp type and + // not GeneralCompEx + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_011() runs on GeneralCompEx system GeneralComp { + map(self:p2, system:p); + f_unmap(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_011()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_012.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6c92480d348474f37f5d95202050db7cfededb2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_012.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for MTC ports in unmap operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_012 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_unmap() runs on GeneralCompEx mtc GeneralComp system GeneralComp { + unmap(mtc:p2, system:p); // although the actual instance of MTC contains the p2 port, + // it cannot be referenced as the mtc clause of the f_connect function contains + // the GeneralComp type and not GeneralCompEx + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_012() runs on GeneralCompEx system GeneralComp { + map(mtc:p2, system:p); + f_unmap(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_012()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_013.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7037344beb2731f0b7e1abf3046dacef4a31cb9b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_013.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for PTC ports in unmap operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_013 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_013() runs on GeneralComp system GeneralComp { + var GeneralCompEx v_ptc := GeneralCompEx.create; + var GeneralComp v_ptcAlias := v_ptc; + map(system:p, v_ptc:p2); + unmap(system:p, v_ptcAlias:p2);// although the actual PTC instance contains the p2 port, + // it cannot be referenced as the variable v_ptc is of the GeneralComp type and + // not GeneralCompEx + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_013()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_014.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c16a50f567b927f88eab5fbad71fc438a61c963 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/NegSem_210102_disconnect_and_unmap_operations_014.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.1.2, violation of strong typing rules for system ports in unmap operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// If the type of the component referenced in a connection operation is known (either +// when the component reference is a variable or value returned from a function or the +// type is defined the runs on, mtc or system clause of the calling function), the +// referenced port declaration shall be present in this component type. + +module NegSem_210102_disconnect_and_unmap_operations_014 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component GeneralCompEx extends GeneralComp { + port P p2; + } + + function f_unmap() runs on GeneralComp system GeneralComp { + unmap(self:p, system:p2); // although the actual instance of TSI contains the p2 port, + // it cannot be referenced as the system clause contains the GeneralComp type and + // not GeneralCompEx + } + + testcase TC_NegSem_210102_disconnect_and_unmap_operations_014() runs on GeneralComp system GeneralCompEx { + map(self:p, system:p2); + f_unmap(); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210102_disconnect_and_unmap_operations_014()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d5f5338db2f80ad886ceb8f36747b5ede7e0562b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_001.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that disconnect operation with two parameters works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The disconnect ... operations perform the disconnection (of previously connected) +// ports of test components... + +module Sem_210102_disconnect_and_unmap_operations_001{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkConnected(boolean p_stateActive) runs on GeneralComp + { + if(p.checkstate("Connected") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_001() runs on GeneralComp system GeneralComp { + // components are created alive so that their connections are not destroyed when behaviour stops + var GeneralComp v_ptc1 := GeneralComp.create alive, + v_ptc2 := GeneralComp.create alive, + v_ptc3 := GeneralComp.create alive; + + connect(v_ptc1:p, v_ptc2:p); + connect(v_ptc1:p, v_ptc3:p); + + disconnect(v_ptc1:p, v_ptc2:p); + + // verity that ports are really disconnected + v_ptc1.start(checkConnected(true)); // still connectected to v_ptc3:p + v_ptc2.start(checkConnected(false)); // no active connection + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_001()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6398ce010ea82bfbb5662097c103524952049037 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_002.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that disconnect operation with one parameter works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// To ease disconnect ... operations related to all connections ... of ... a port, it is +// allowed to use disconnect ... operations with one argument only. This one argument +// specifies one side of the connections to be disconnected... + +module Sem_210102_disconnect_and_unmap_operations_002{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkDisconnected() runs on GeneralComp + { + if(not p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_002() runs on GeneralComp system GeneralComp { + // components are created alive so that their connections are not destroyed when behaviour stops + var GeneralComp v_ptc1 := GeneralComp.create alive, + v_ptc2 := GeneralComp.create alive, + v_ptc3 := GeneralComp.create alive; + + connect(v_ptc1:p, v_ptc2:p); + connect(v_ptc1:p, v_ptc3:p); + + disconnect(v_ptc1:p); + + // verity that ports are really disconnected + v_ptc2.start(checkDisconnected()); + v_ptc3.start(checkDisconnected()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_002()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_003.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5830abea654a41a640235aece5820f5d42fbdaeb --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_003.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that disconnect operation with all ports of a component works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// To ease disconnect ... operations related to all connections ... of a component ..., +// it is allowed to use disconnect ... operations with one argument only. This one argument +// specifies one side of the connections to be disconnected... The all port keyword can be +// used to denote all ports of a component. + +module Sem_210102_disconnect_and_unmap_operations_003{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + function checkAllDisconnected() runs on GeneralComp + { + timer t := 1.0; + t.start; + if(not p1.checkstate("Connected") and not p2.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + function checkSecondConnected() runs on GeneralComp + { + if(not p1.checkstate("Connected") and p2.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_003() runs on GeneralComp system GeneralComp { + // components are created alive so that their connections are not destroyed when behaviour stops + var GeneralComp v_ptc1 := GeneralComp.create alive, + v_ptc2 := GeneralComp.create alive, + v_ptc3 := GeneralComp.create alive; + + connect(v_ptc1:p1, v_ptc2:p1); + connect(v_ptc1:p2, v_ptc3:p1); + connect(v_ptc2:p2, v_ptc3:p2); + + disconnect(v_ptc1:all port); + + // verity that ports are really disconnected + v_ptc1.start(checkAllDisconnected()); + v_ptc2.start(checkSecondConnected()); + v_ptc3.start(checkSecondConnected()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_003()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_004.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ffaaeb85259d455d106cdc4e1feab74cba339840 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_004.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that disconnect operation with no argument works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The usage of a disconnect ... operation without any parameters is a shorthand +// form for using the operation with the parameter self:all port. It disconnects +// ... all ports of the component that calls the operation. + +module Sem_210102_disconnect_and_unmap_operations_004{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + function checkSecondConnected() runs on GeneralComp + { + if(not p1.checkstate("Connected") and p2.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_004() runs on GeneralComp system GeneralComp { + // components are created alive so that their connections are not destroyed when behaviour stops + var GeneralComp v_ptc1 := GeneralComp.create alive, + v_ptc2 := GeneralComp.create alive; + + connect(self:p1, v_ptc1:p1); + connect(self:p2, v_ptc2:p1); + connect(v_ptc1:p2, v_ptc2:p2); + + disconnect; + + // verity that ports are really disconnected + v_ptc1.start(checkSecondConnected()); + v_ptc2.start(checkSecondConnected()); + if(not p1.checkstate("Connected") and not p2.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_004()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_005.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8431847de808b349bdaf0b9d400cfd42bd6032b1 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_005.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that unmap operation with one system port as a parameter works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// To ease ... map operations related to all ... mappings of ... a port, it is +// allowed to use ... unmap operations with one argument only. This one argument +// specifies one side of the connections to be ... unmapped. + +module Sem_210102_disconnect_and_unmap_operations_005 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkUnmapped() runs on GeneralComp + { + if(not p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p, system:p); + map(v_ptc1:p, system:p); + + unmap(system:p); + + // verity that ports are really unmapped + checkUnmapped(); + v_ptc1.start(checkUnmapped()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_005()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_006.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a9d971249a393268ae6dca07ffd8dfc997b0401 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_006.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that unmap operation with one component port as a parameter works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// To ease ... map operations related to all ... mappings of ... a port, it is +// allowed to use ... unmap operations with one argument only. This one argument +// specifies one side of the connections to be ... unmapped. + +module Sem_210102_disconnect_and_unmap_operations_006 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkMapped(boolean p_stateActive) runs on GeneralComp + { + if(p.checkstate("Mapped") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p, system:p); + map(v_ptc1:p, system:p); + + unmap(v_ptc1:p); + + // verity that ports are really unmapped + checkMapped(true); // still mapped to system:p + v_ptc1.start(checkMapped(false)); // no active mapping + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_006()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_007.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7044d3da16fa1e1a4aea5999ebf0fb606320afd7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_007.ttcn @@ -0,0 +1,58 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that unmap operation with all ports of a component works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// To ease ... map operations related to all ... mappings of a component ..., it is +// allowed to use ... unmap operations with one argument only. This one argument +// specifies one side of the connections to be ... unmapped. The all port keyword +// can be used to denote all ports of a component. + +module Sem_210102_disconnect_and_unmap_operations_007 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + function checkPortMapped(boolean p_stateActive, P p_port) + { + if(p_port.checkstate("Mapped") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + function checkMapped(boolean p_stateActive) runs on GeneralComp + { + checkPortMapped(p_stateActive, p1); + checkPortMapped(p_stateActive, p2); + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p1, system:p1); + map(self:p2, system:p2); + map(v_ptc1:p1, system:p1); + map(v_ptc1:p2, system:p2); + + unmap(v_ptc1:all port); + + // verity that ports are really unmapped + checkMapped(true); // still mapped to system:p1 and system:p2 + v_ptc1.start(checkMapped(false)); // no active mapping + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_007()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_008.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4df0033ce7485a793ea1fbd9b9063b72b76c234 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_008.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that unmap operation with no parameters works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The usage of an ... unmap operation without any parameters is a shorthand +// form for using the operation with the parameter self:all port. It ... +// unmaps all ports of the component that calls the operation. + +module Sem_210102_disconnect_and_unmap_operations_008 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + function checkPortMapped(boolean p_stateActive, P p_port) + { + if(p_port.checkstate("Mapped") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + function checkMapped(boolean p_stateActive) runs on GeneralComp + { + checkPortMapped(p_stateActive, p1); + checkPortMapped(p_stateActive, p2); + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p1, system:p1); + map(self:p2, system:p2); + map(v_ptc1:p1, system:p1); + map(v_ptc1:p2, system:p2); + + unmap; + + // verity that ports are really unmapped + checkMapped(false); // no active mapping + v_ptc1.start(checkMapped(true)); // still mapped to system:p1 and system:p2 + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_008()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_009.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eac5aa8f601a2bf1afd653d2e8a964512ff4b81c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_009.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Ensure that all component notation works correctly in unmap operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The all component keyword shall only be used in combination with the all port +// keyword, i.e. all component:all port, and shall only be used by the MTC. Furthermore, +// the all component:all port argument shall be used as the one and only argument of a +// disconnect or unmap operation and it allows to release all connections and mappings +// of the test configuration. + +module Sem_210102_disconnect_and_unmap_operations_009 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p1, p2; + } + + function checkUnmapped() runs on GeneralComp + { + if(not p1.checkstate("Mapped") and not p2.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p1, system:p1); + map(self:p2, system:p2); + map(v_ptc1:p1, system:p1); + map(v_ptc1:p2, system:p2); + + unmap(all component:all port); + + // verity that ports are really unmapped + checkUnmapped(); + v_ptc1.start(checkUnmapped()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_009()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_010.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79f30a5cc5805a961d28bdc4af121e4e26e7bcd2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_010.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that no error is generated when unmapping ports that are not mapped + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// An ... unmap operation has only an effect if the ... mapping to be removed +// has been created beforehand. + +module Sem_210102_disconnect_and_unmap_operations_010 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + connect(self:p, v_ptc1:p); + unmap( v_ptc1:p, system:p); //no effect, ports not mapped + setverdict(pass); + } + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_010()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_011.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f30bbf418501526bcb7bca6ea6a9c669c8d4a5e0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_011.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 470 and STF 521) + ** @version 0.0.3 + ** @purpose 1:21.1.2, Ensure that unmap param statements are allowed in testcase block + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210102_disconnect_and_unmap_operations_011 { + + type component GeneralComp { + port MyMessagePortType pt_myPort; + } + + type record MyMessageType1 { + boolean h1, + MyMessageType1 h2 optional + } + + type record MyMessageType2 { + integer g1, + charstring g2 + } + + type port MyMessagePortType message { + inout all; + unmap param (in MyMessageType1 p1, inout MyMessageType2 p2); + } + + const MyMessageType1 c_myTemplate1 := { + h1 := false, + h2 := { + h1:= true, + h2 := omit + } + } + + const MyMessageType2 c_myTemplate2 := { + g1 := 2, + g2 := "foo" + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_011() runs on GeneralComp system GeneralComp { + var MyMessageType2 v_myTemplate2 := c_myTemplate2; + timer t_tmr := 0.2; + t_tmr.start; + map(mtc:pt_myPort, system:pt_myPort); + + pt_myPort.send(13); + t_tmr.timeout; // give adapter some time to enqueue the message + + unmap(mtc:pt_myPort, system:pt_myPort) param(c_myTemplate1, v_myTemplate2); + log("Unmap inout parameter", v_myTemplate2); + + setverdict(pass); + } + + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_012.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31eb95f3d1a6f2edbf94477117f4a757396d6fc7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_012.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that the param part can be skipped in unmap operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Restriction b: +// In unmap operations, param clauses are optional. + +module Sem_210102_disconnect_and_unmap_operations_012 { + + type port P message { + inout integer; + unmap param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_012() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(self:p, system:p); + if(not p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_012()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_013.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ab5dc57e13de9ddd8fb5efa2b305802b9312340 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_and_unmap_operations_013.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1.2, Verify that the param clause can be used when unmap contains a single system port parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Restriction a: +// In an unmap operation, a param clause shall only be present if the system port to +// which the param clause belongs to is explicitly referenced. + +module Sem_210102_disconnect_and_unmap_operations_013 { + + type port P message { + inout integer; + unmap param (integer p_par1); + } + + type component GeneralComp { + port P p + } + + testcase TC_Sem_210102_disconnect_and_unmap_operations_013() runs on GeneralComp system GeneralComp { + map(system:p, self:p); + unmap(system:p) param(1); + if(not p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control{ + execute(TC_Sem_210102_disconnect_and_unmap_operations_013()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..367d867158d3fee95969df75cae01c5a7b9229db --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 451, STF 470 + ** @version 0.0.2 + ** @purpose 1:21.1.2, Ensure that all component notation work correctly in disconnect operation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The all component keyword shall only be used in combination with the all port +// keyword, i.e. all component:all port, and shall only be used by the MTC. Furthermore, +// the all component:all port argument shall be used as the one and only argument of a +// disconnect or unmap operation and it allows to release all connections and mappings +// of the test configuration. + +module Sem_210102_disconnect_operation_001{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + timer t := 1.0; + t.start; + if(not p.checkstate("Connected")) { + setverdict(pass); + } else { + setverdict(fail); + } + t.timeout; // keep alive for 1 second + } + + testcase TC_Sem_210102_disconnect_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create, + v_ptc3 := GeneralComp.create; + + connect(v_ptc1:p, v_ptc2:p); + connect(v_ptc1:p, v_ptc3:p); + connect(v_ptc2:p, v_ptc3:p); + + disconnect(all component:all port); + + // verity that ports are really disconnected + v_ptc1.start(f()); + v_ptc2.start(f()); + v_ptc3.start(f()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_operation_001()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..77136545d583c930bb73ede7dcc41cbc57475b5c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_002.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 451, STF 470 + ** @version 0.0.2 + ** @purpose 1:21.1.1, Ensure that disconnect has no effect on components that are not connected + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_210102_disconnect_operation_002{ + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + if(p.checkstate("Mapped")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_disconnect_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create; + + map(v_ptc1:p, system:p); + + disconnect(v_ptc1:p, v_ptc2:p); // acceptable even when not connected + + v_ptc1.start(f()); + all component.done; + } + control{ + execute(TC_Sem_210102_disconnect_operation_002()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb7e1f48423cf42d431c5db0bb08f22c58d784e1 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_disconnect_operation_003.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.1.2, Ensure that mapped port cannot disconnect + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// System and component interface cannot disconnect +module Sem_210102_disconnect_operation_003 { + + type port myport message { + inout integer + } + + + type component Mysystem + { + port myport messagePort; + } + function f() runs on Mysystem {} + + testcase TC_Sem_210102_disconnect_operation_003() runs on Mysystem system Mysystem { + var Mysystem MyCompA; + + MyCompA:=Mysystem.create; + + map(MyCompA:messagePort,system:messagePort); + + MyCompA.start(f()); + + disconnect(MyCompA:messagePort); // should not cause any error + setverdict(pass); + } + control{ + execute(TC_Sem_210102_disconnect_operation_003()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..833827e432e24481bd8c4fd2cce91bcccfa660aa --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_001.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 451, STF 470 + ** @version 0.0.2 + ** @purpose 1:21.1.2, Ensure that umnap operation of a system and component port works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The ... unmap operations perform ... the unmapping of (previously mapped) ports of +// test components and ports in the test system interface. + +module Sem_210102_unmap_operation_001 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkMapped(boolean p_stateActive) runs on GeneralComp + { + if(p.checkstate("Mapped") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_unmap_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p, system:p); + map(v_ptc1:p, system:p); + + unmap(system:p, v_ptc1:p); + + // verity that ports are really unmapped + checkMapped(true); // still mapped to system:p + v_ptc1.start(checkMapped(false)); // no active mapping + v_ptc1.done; + } + + control{ + execute(TC_Sem_210102_unmap_operation_001()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1a38616f8dc2a8ff76c2ff793b44691a3b5b579 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/210102_disconnect_and_unmap_operations/Sem_210102_unmap_operation_002.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 451, STF 470 + ** @version 0.0.2 + ** @purpose 1:21.1.2, Ensure that umnap operation of a component and system port works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The ... unmap operations perform ... the unmapping of (previously mapped) ports of +// test components and ports in the test system interface. + +module Sem_210102_unmap_operation_002 { + + type port P message { + inout integer + } + + type component GeneralComp + { + port P p; + } + + function checkMapped(boolean p_stateActive) runs on GeneralComp + { + if(p.checkstate("Mapped") xor not p_stateActive) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + testcase TC_Sem_210102_unmap_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create; + + map(self:p, system:p); + map(v_ptc1:p, system:p); + + unmap(v_ptc1:p, system:p); + + // verity that ports are really unmapped + checkMapped(true); // still mapped to system:p + v_ptc1.start(checkMapped(false)); // no active mapping + v_ptc1.done; + } + + control{ + execute(TC_Sem_210102_unmap_operation_001()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_001.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15590619d3293aa77872d0eeda15fa80817c893e --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1, Verify that connect operation cannot contain a system port + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// In the case of connections between two test components, the connect operation shall be used. + +module NegSem_2101_TopLevel_001 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_210101_TopLevel_001() runs on GeneralComp system GeneralComp { + connect(self:p, system:p); // error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_TopLevel_001()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_002.ttcn b/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..063dd48c59de0342bdc091a26912ca3ef005a1c8 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2101_connection_operations/2101_toplevel/NegSem_2101_TopLevel_002.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.1, Verify that map operation fails if both operands are component ports + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// When connecting a test component to a test system interface the map operation shall be used. + +module NegSem_2101_TopLevel_002 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_210101_TopLevel_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + map(self:p, v_ptc:p); // error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_210101_TopLevel_002()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2102_test_case_operations/NegSem_2102_testcase_stop_001.ttcn b/ATS/core_language/21_configuration_operations/2102_test_case_operations/NegSem_2102_testcase_stop_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7de401fa359d2d71e96a364ec155989578da5bb2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2102_test_case_operations/NegSem_2102_testcase_stop_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.2, Stopping test case + ** @verdict pass accept, ttcn3verdict:error + ***************************************************/ +// Explicit test case termination test +module NegSem_2102_testcase_stop_001 { + type component GeneralComp {} + + testcase TC_NegSem_2102_testcase_stop_001() runs on GeneralComp { + var boolean v_b := true; + + setverdict(pass, "Unexpected termination with verdict pass"); + + testcase.stop("Expected Termination with verdict error"); // stop runing test case now with verdict error + } + + control { + execute(TC_NegSem_2102_testcase_stop_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd39ef732385bfcfb64b6af698916996052c4cdd --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_001.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named components on hosts are accepted + ** @verdict pass reject + *****************************************************************/ +module NegSem_210301_CreateOperation_001 { + + type component GeneralComp { } + + testcase TC_NegSem_210301_CreateOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create(5); // it should expect charstring + setverdict(pass); + } + + control { + execute(TC_NegSem_210301_CreateOperation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..543052d4948e342c9d9b8acaba923be4c4aa8c89 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_002.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named components on hosts are accepted + ** @verdict pass reject + *****************************************************************/ +module NegSem_210301_CreateOperation_002 { + + type component GeneralComp { } + + testcase TC_NegSem_210301_CreateOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create(true); // it should expect charstring + setverdict(pass); + } + + control { + execute(TC_NegSem_210301_CreateOperation_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a546da0850499c1ec79da194f091adfb46a9ca5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/NegSem_210301_CreateOperation_003.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named components on hosts are accepted + ** @verdict pass reject + *****************************************************************/ +module NegSem_210301_CreateOperation_003 { + + type component GeneralComp { } + + testcase TC_NegSem_210301_CreateOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create(-, 'CAFFEE'O); // it should expect charstring + setverdict(pass); + } + + control { + execute(TC_NegSem_210301_CreateOperation_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d29cb5872d7d31a06655be93da4e0a98c63935b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_001.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that unnamed components can be created + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210301_CreateOperation_001 { + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + type component NewComp { } + + function f_testComp() runs on GeneralComp { + var NewComp v_NewComp := NewComp.create; + t.start; + a_createComp(); + setverdict(pass); + } + + function f_createComp() return NewComp { + return NewComp.create; + } + + altstep a_createComp() runs on GeneralComp { + [] t.timeout { + vc_NewComp := NewComp.create; + setverdict(pass); + } + } + + testcase TC_Sem_210301_CreateOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + ptc.start(f_testComp()); + setverdict(pass); + } + + control { + execute(TC_Sem_210301_CreateOperation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d064983082fa58a5ab06d0c46e6a9ca6be37698 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_002.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named components can be created + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210301_CreateOperation_002 { + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + + type component NewComp { } + + function f_testComp() runs on GeneralComp { + var NewComp v_NewComp := NewComp.create("1 & * 5abc"); + t.start; + a_createComp(); + setverdict(pass); + } + + function f_createComp() return NewComp { + return NewComp.create("some name"); + } + + altstep a_createComp() runs on GeneralComp { + [] t.timeout { + vc_NewComp := NewComp.create("component#" & int2str(2)); + setverdict(pass); + } + } + + testcase TC_Sem_210301_CreateOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create("a component name"); + ptc.start(f_testComp()); + setverdict(pass); + } + + control { + execute(TC_Sem_210301_CreateOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39d087412cbee21db252f0afedf17d2d54dae356 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_003.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that unnamed alive components on hosts can be created + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210301_CreateOperation_003 { + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + + type component NewComp { } + + function f_testComp() runs on GeneralComp { + var NewComp v_NewComp := NewComp.create alive; + t.start; + a_createComp(); + setverdict(pass); + } + + function f_createComp() return NewComp { + return NewComp.create alive; + } + + altstep a_createComp() runs on GeneralComp { + [] t.timeout { + vc_NewComp := NewComp.create alive; + setverdict(pass); + } + } + + testcase TC_Sem_210301_CreateOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create alive; + ptc.start(f_testComp()); + setverdict(pass); + } + + control { + execute(TC_Sem_210301_CreateOperation_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00f82b19b0f7c5227bf3ff0ae92ffbb8319e2408 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Sem_210301_CreateOperation_004.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named alive components can be created + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210301_CreateOperation_004 { + const charstring componentName := "component#"; + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + + type component NewComp { } + + function f_testComp() runs on GeneralComp { + var NewComp v_NewComp := NewComp.create("1 & * 5abc") alive; + t.start; + a_createComp(); + setverdict(pass); + } + + function f_createComp() return NewComp { + return NewComp.create("some name") alive; + } + + altstep a_createComp() runs on GeneralComp { + [] t.timeout { + vc_NewComp := NewComp.create(componentName & int2str(2)) alive; + setverdict(pass); + } + } + + testcase TC_Sem_210301_CreateOperation_004() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create("a component name") alive; + ptc.start(f_testComp()); + setverdict(pass); + } + + control { + execute(TC_Sem_210301_CreateOperation_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Syn_210301_CreateOperation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Syn_210301_CreateOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46b224c1a34ec09e4703ad3a64d63c04ab0f7cf0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210301_create_operation/Syn_210301_CreateOperation_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.1, Ensure that named components on hosts are accepted + ** @verdict pass accept, noexecution + *****************************************************************/ +// only syntactic test since it cannot be tested if "localhost" is not supported for component creation +module Syn_210301_CreateOperation_001 { + const charstring hostname := "localhost"; + + type component GeneralComp { + var NewComp vc_NewComp; + timer t := 5.0; + } + + type component NewComp { } + + function f_testComp() runs on GeneralComp { + var NewComp v_NewComp := NewComp.create("1 & * 5abc", hostname); + t.start; + a_createComp(); + setverdict(pass); + } + + function f_createComp() return NewComp { + return NewComp.create(-, "localhost"); + } + + altstep a_createComp() runs on GeneralComp { + [] t.timeout { + vc_NewComp := NewComp.create("component#" & int2str(2), hostname); + setverdict(pass); + } + } + + testcase TC_Syn_210301_CreateOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create("a component name", "localhost"); + ptc.start(f_testComp()); + setverdict(pass); + } + + control { + execute(TC_Syn_210301_CreateOperation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73058d190c4af81124ae8188e0b189b189ed26db --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that non-alive ptc cannot start again + ** @verdict pass reject + *****************************************************************/ +//Non alive test component cannot start another function behavior +module NegSem_210302_Start_test_component_001 { + + type component GeneralComp { } + function f() runs on GeneralComp {} + function f2() runs on GeneralComp {} + + testcase TC_NegSem_210302_Start_test_component_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create; + + ptc.start(f()); + ptc.done; + ptc.start(f2()); // test case error, ptc is non-alive + + setverdict(pass); + } + + control { + execute(TC_NegSem_210302_Start_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fdadc235c91e7dc880c6b6c8c07c002018fdf67b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_002.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that only component type is allowed for ptc declaration + ** @verdict pass reject + *****************************************************************/ +// VariableRef (being a component type variable, a component type parameter +module NegSem_210302_Start_test_component_002 { + + type component GeneralComp { } + type record Rectype{} + function f() runs on GeneralComp {} + testcase TC_NegSem_210302_Start_test_component_002() runs on GeneralComp system GeneralComp { + var Rectype ptc; + ptc:=GeneralComp.create; // VariableRef (being a component type variable, a component type parameter + + ptc.start(f()); + + setverdict(pass); + } + + control { + execute(TC_NegSem_210302_Start_test_component_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f13f44196fec6306279a50dc0a6f0dde2ba3a781 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, starting behaviour on already running non-alive component + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Starting a second behaviour function on a non-alive PTC or starting a function +// on a PTC that is still running results in a test case error. + +module NegSem_210302_Start_test_component_004 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + testcase TC_NegSem_210302_Start_test_component_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_004()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8e65c1c024a86cbbf65139b278c8242848ec3d0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_005.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, starting behaviour on already running non-alive component + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Starting a second behaviour function on a non-alive PTC or starting a function +// on a PTC that is still running results in a test case error. + +module NegSem_210302_Start_test_component_005 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 10.0; + t_tmr.start; + t_tmr.timeout; + } + + testcase TC_NegSem_210302_Start_test_component_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + v_ptc.start(f_ptcBehaviour()); + v_ptc.start(f_ptcBehaviour()); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ecda5db8b92c5822e735c4e22b0089d98e5f8c42 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_006.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, function invocation in the start operation doesn't return a component + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// The variable associated with VariableRef (being a component type variable, +// a component type parameter, etc.) or the return type associated with +// FunctionInstance shall be of component type. + +module NegSem_210302_Start_test_component_006 { + + type component GeneralComp { + } + + type record R { + GeneralComp comp + } + + function f_create() return R { + var R v_rec := { GeneralComp.create("PTC") } + return v_rec; + } + + function f_ptcBehaviour() runs on GeneralComp { + } + + testcase TC_NegSem_210302_Start_test_component_006() runs on GeneralComp system GeneralComp { + f_create().start(f_ptcBehaviour()); + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a568efbf8006ed9bde0f79f2d9c54b1bcd7b41a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_007.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, starting function with incompatible "runs on" clause + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// The function invoked in a start test component operation shall have a runs on +// definition referencing a component type that is compatible with the newly +// created component (see clause 6.3.3). + +module NegSem_210302_Start_test_component_007 { + + type component GeneralComp { + var charstring vc_str := "abc"; + } + + type component DifferentComp { + var integer vc_int := 0; + } + + + function f_ptcBehaviour() runs on DifferentComp { + setverdict(pass, "Executing PTC behaviour..."); + } + + testcase TC_NegSem_210302_Start_test_component_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_007()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d614298d7c83ee64ee66aa9be7bc484c39f86acc --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_008.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, passing port to started component function + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function invoked in a start +// test component operation. + +module NegSem_210302_Start_test_component_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_behaviour(P p_port) runs on GeneralComp { + p_port.receive(integer:?); + setverdict(pass); + } + + testcase TC_NegSem_210302_Start_test_component_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, self:p); + p.send(1); + v_ptc.start(f_behaviour(p)); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_008()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..95aac9a1e62db3373af7e7ea658b8ffe897f390c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_009.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, passing default to started component function + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function invoked in a start +// test component operation. + +module NegSem_210302_Start_test_component_009 { + + type component GeneralComp { + } + + function f_behaviour(default p_default) runs on GeneralComp { + setverdict(pass); + } + + altstep a_timeout() { + [] any timer.timeout { } + } + + testcase TC_NegSem_210302_Start_test_component_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + var default v_def := activate(a_timeout()); + v_ptc.start(f_behaviour(v_def)); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_009()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cdb496a4c27bfcb36ce3cb1c4d3dcca0a19169bd --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_010.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, passing timer to started component function + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Ports, defaults and timers shall not be passed into a function invoked in a start +// test component operation. + +module NegSem_210302_Start_test_component_010 { + + type component GeneralComp { + } + + function f_behaviour(timer t_tmr) runs on GeneralComp { + t_tmr.timeout; + setverdict(pass); + } + + testcase TC_NegSem_210302_Start_test_component_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + timer t_tmr := 0.0; + t_tmr.start; + v_ptc.start(f_behaviour(t_tmr)); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_010()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f01f3dd1e8a867fb8c0dc6703055354fbe6fe5c9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_011.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, passing structured value containing ports to started component function + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// All formal parameter types of the function shall neither be of port or default type +// or should contain a direct or indirect element or field of port or default type. + +module NegSem_210302_Start_test_component_011 { + + type port P message { + inout integer; + } + + type P PortArray[2]; + + type component GeneralComp { + port P p[2]; + } + + function f_behaviour(PortArray p_ports) runs on GeneralComp { + p_ports[0].receive(integer:?); + setverdict(pass); + } + + testcase TC_NegSem_210302_Start_test_component_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p[0], self:p[0]); + p[0].send(1); + v_ptc.start(f_behaviour(p)); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_011()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f803ddff70b46d13cb02ea229e0f9a78fa52de9d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/NegSem_210302_Start_test_component_012.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, passing default to started component function + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// All formal parameter types of the function shall neither be of port or default type +// or should contain a direct or indirect element or field of port or default type. + +module NegSem_210302_Start_test_component_012 { + + type record R { + default def + } + + type component GeneralComp { + } + + function f_behaviour(R p_def) runs on GeneralComp { + setverdict(pass); + } + + altstep a_timeout() { + [] any timer.timeout { } + } + + testcase TC_NegSem_210302_Start_test_component_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + var R v_def := { def := activate(a_timeout()) }; + v_ptc.start(f_behaviour(v_def)); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_NegSem_210302_Start_test_component_012()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23f934f2fa7727ac9e4c44a572c8989ee1ffbfe4 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that alive test components are allowed to start another function + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Alive test component starts another function +module Sem_210302_Start_test_component_001 { + + type component GeneralComp { } + function f() runs on GeneralComp {} + function f2() runs on GeneralComp {} + + testcase TC_Sem_210302_Start_test_component_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + ptc.start(f()); + ptc.done; + ptc.start(f2()); // allowed since ptc is alive + + setverdict(pass); + } + + control { + execute(TC_Sem_210302_Start_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e0e1b1642c0caf68304788579f095b50a5ee62c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_002.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, component variable reference in start operation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The start operation shall bind the required behaviour to the test component. This +// behaviour is defined by reference to an already defined function. + +module Sem_210302_Start_test_component_002 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + setverdict(pass, "Executing PTC behaviour..."); + } + + testcase TC_Sem_210302_Start_test_component_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_002()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75269f2ad61b5defd96d95f8b8dd5dd66690850a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_003.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, test component as a result of function invocation in start operation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The start operation shall bind the required behaviour to the test component. This +// behaviour is defined by reference to an already defined function. + +module Sem_210302_Start_test_component_003 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + setverdict(pass, "Executing PTC behaviour..."); + } + + function f_create() return GeneralComp { + return GeneralComp.create("PTC"); + } + + testcase TC_Sem_210302_Start_test_component_003() runs on GeneralComp system GeneralComp { + f_create().start(f_ptcBehaviour()); + all component.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_003()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3f9245a784447c12465715e57f452056606cf3c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_004.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, component variable value reuse in alive component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If a function is started on an alive-type PTC after termination of a previous +// function, it uses variable values, timers, ports, and the local verdict as they +// were left after termination of the previous function. + +module Sem_210302_Start_test_component_004 { + + type component GeneralComp { + var integer vc_val := 0; + } + + function f_ptcBehaviour() runs on GeneralComp { + vc_val := 1; + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (vc_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_210302_Start_test_component_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_004()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a680c5062fd80338e8e27aab99d233f864bd6c9b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_005.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, timer reuse in alive component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If a function is started on an alive-type PTC after termination of a previous +// function, it uses variable values, timers, ports, and the local verdict as they +// were left after termination of the previous function. + +module Sem_210302_Start_test_component_005 { + + type component GeneralComp { + timer tc_tmr := 30.0; + } + + function f_ptcBehaviour() runs on GeneralComp { + tc_tmr.start; + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (tc_tmr.running) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_210302_Start_test_component_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2f3b2ef45d6b7f6edd1163bd155fe3502edaed9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_006.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, port reuse in alive component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If a function is started on an alive-type PTC after termination of a previous +// function, it uses variable values, timers, ports, and the local verdict as they +// were left after termination of the previous function. + +module Sem_210302_Start_test_component_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + connect(self:p, self:p); // loopback + p.send(1); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + p.receive(integer:?); + } + + + testcase TC_Sem_210302_Start_test_component_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f95f89073965185c7eadf01ca512c12e9e16508 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_007.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, verdict value reuse in alive component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If a function is started on an alive-type PTC after termination of a previous +// function, it uses variable values, timers, ports, and the local verdict as they +// were left after termination of the previous function. + +module Sem_210302_Start_test_component_007 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + setverdict(pass); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (getverdict != pass) { setverdict(fail); } + } + + + testcase TC_Sem_210302_Start_test_component_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_007()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..709cea98a7d5ea0300130402566c5a8694f79bb0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_008.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, timer reuse in alive component + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If a function is started on an alive-type PTC after termination of a previous +// function, it uses variable values, timers, ports, and the local verdict as they +// were left after termination of the previous function. + +module Sem_210302_Start_test_component_008 { + + type component GeneralComp { + timer tc_tmr := 30.0; + } + + function f_ptcBehaviour() runs on GeneralComp { + tc_tmr.start; + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (tc_tmr.running) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_210302_Start_test_component_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_008()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9190fa4523d3b3de3b295f029b5ed08d62fe8ce9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_009.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, deactivation of defaults in alive components + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// In contrast to that, all active defaults are deactivated when the behaviour of +// an alive-type PTC is stopped. This means no default is activated when a new +// behaviour is started on an alive-type PTC. + +module Sem_210302_Start_test_component_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + timer tc_tmr := 1.0; + port P p; + } + + altstep a_receive() runs on GeneralComp { + [] p.receive(integer:?) { setverdict(fail); } + } + + function f_ptcBehaviour() runs on GeneralComp { + activate(a_receive()); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + tc_tmr.start; + alt { + [] tc_tmr.timeout { setverdict(pass); } + } + } + + + testcase TC_Sem_210302_Start_test_component_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + connect(self:p, v_ptc:p); + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + p.send(2); + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..daf8e07cb32723bee4283a57522c3742cf32a5ad --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_010.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, starting function with compatible "runs on" clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The function invoked in a start test component operation shall have a runs on +// definition referencing a component type that is compatible with the newly +// created component (see clause 6.3.3). + +module Sem_210302_Start_test_component_010 { + + type component GeneralComp { + } + + type component GeneralCompEx extends GeneralComp { + var integer vc_int := 0; + } + + + function f_ptcBehaviour() runs on GeneralComp { + setverdict(pass, "Executing PTC behaviour..."); + } + + testcase TC_Sem_210302_Start_test_component_010() runs on GeneralComp system GeneralComp { + var GeneralCompEx v_ptc := GeneralCompEx.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_010()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8fd664b5f3d09b19eabad34d43588d52163b98c5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_011.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.3.2, altstep in test component start operation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The start operation shall bind the required behaviour to the test component. This +// behaviour is defined by reference to an already defined function or altstep. +// NOTE: altstep support added in TTCN-3:2016 -> the test was changed to positive one. + +module Sem_210302_Start_test_component_011 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a_test() runs on GeneralComp { + [] p.receive(integer:?) { + setverdict(pass); + } + } + + testcase TC_Sem_210302_Start_test_component_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.send(1); + v_ptc.start(a_test()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210302_Start_test_component_011()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6c8012b92147ac5d57f5713ccfd0b1192aee75a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_012.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that start operation works with parametered altsteps + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirement is tested: The start operation shall bind the required behaviour to the test component. +// This behaviour is defined by reference to an already defined function or altstep. + +module Sem_210302_Start_test_component_012 { + + type port myPortType message { + inout integer; + } + + type component GeneralCompSystem { } + type component GeneralComp { + port myPortType myPort; + } + + altstep a_myBehaviour() runs on GeneralComp { + + [] any port.receive { + setverdict(pass); + } + } + + + testcase TC_Sem_210302_Start_test_component_012() runs on GeneralComp system GeneralCompSystem { + var GeneralComp ptc; + + ptc:=GeneralComp.create alive; + + connect(mtc:myPort, ptc:myPort); + myPort.send(1); + + ptc.start(a_myBehaviour()); + ptc.done; + + setverdict(pass); + } + + control { + execute(TC_Sem_210302_Start_test_component_012()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_013.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e832f71ee598eb85977d2bc45a26130ffcab55c9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_013.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that inout parameters will be passed to the function by value, i.e. like in-parameters. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Actual inout parameters will be passed to the function by value, i.e. like in-parameters. + +module Sem_210302_Start_test_component_013 { + + type component GeneralComp { } + function f(inout integer v_in) runs on GeneralComp { + if(match(v_in,5)){ setverdict(pass); } + + } + + testcase TC_Sem_210302_Start_test_component_013() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var integer v_var:=5; + ptc:=GeneralComp.create alive; + ptc.start(f(v_var)); + setverdict(pass); + } + + control { + execute(TC_Sem_210302_Start_test_component_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_014.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3720ab8970367f077b91cc933ca811a77a5e641 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210302_start_test_component/Sem_210302_Start_test_component_014.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:21.3.2, Ensure that inout parameters will be passed to the function by value, i.e. like in-parameters. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Possible return values of a function invoked in a start test component operation, +// i.e. templates denoted by return keyword or inout and out parameters, have no effect +// when the started test component terminates. + +module Sem_210302_Start_test_component_014 { + + type component GeneralComp { + var integer v_var:=5; + } + + function f() runs on GeneralComp return integer { + v_var:=1; + return v_var; // return value v_var:=1 + } + + testcase TC_Sem_210302_Start_test_component_014() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + + ptc:=GeneralComp.create alive; + ptc.start(f()); + + if(match(v_var,5)){ + setverdict(pass); + } + else { + setverdict(fail,v_var); + } + } + + control { + execute(TC_Sem_210302_Start_test_component_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48e948f794da1c159dc48b8e2ebeefb66f62d5e7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, restarting explicitly stopped non-alive component + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Stopping a non-alive-type test component (implicitly or explicitly) shall destroy +// it and all resources associated with the test component shall be released. + +module NegSem_210303_Stop_test_component_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_NegSem_210303_Stop_test_component_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + ptc.start(f()); + ptc.stop; + ptc.start(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210303_Stop_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca494de6e0d3869845655e0f29d28b9ac5aea6d5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, stopping all PTCs from a PTC + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The all keyword can be used by the MTC only in order to stop all running PTCs but +// the MTC itself. + +module NegSem_210303_Stop_test_component_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + all component.stop; + } + + testcase TC_NegSem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + ptc.start(f()); + ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_210303_Stop_test_component_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d31c32de172754c27f3e950245d335d7fbd5c32 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_003.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, applying stop operation to a variable of a different than component type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable associated with VariableRef (being a component type variable, a component +// type parameter, etc.) or the return type associated with FunctionInstance shall be of +// component type. + +module NegSem_210303_Stop_test_component_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_behaviour() runs on GeneralComp { + p.receive(integer:?); // infinite blocking + } + + testcase TC_NegSem_210303_Stop_test_component_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc[2]; + v_ptc[0] := GeneralComp.create; + v_ptc[1] := GeneralComp.create; + v_ptc[0].start(f_behaviour()); + v_ptc[1].start(f_behaviour()); + v_ptc.stop; + setverdict(pass); + } + + control { + execute(TC_NegSem_210303_Stop_test_component_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ca8deddeeee44a07917a2c5a65f195775cb256e --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/NegSem_210303_Stop_test_component_004.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, applying stop operation to a function call result of a different than component type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable associated with VariableRef (being a component type variable, a component +// type parameter, etc.) or the return type associated with FunctionInstance shall be of +// component type. + +module NegSem_210303_Stop_test_component_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type GeneralComp CompArray[2]; + + function f_behaviour() runs on GeneralComp { + p.receive(integer:?); // infinite blocking + } + + function f_createComponents() return CompArray { + var CompArray v_ptc; + v_ptc[0] := GeneralComp.create; + v_ptc[1] := GeneralComp.create; + v_ptc[0].start(f_behaviour()); + v_ptc[1].start(f_behaviour()); + return v_ptc; + } + + testcase TC_NegSem_210303_Stop_test_component_004() runs on GeneralComp system GeneralComp { + f_createComponents().stop; + setverdict(pass); + } + + control { + execute(TC_NegSem_210303_Stop_test_component_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a781610b5387f15ce48ede865c45f9073e1a9f48 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.3, Ensure that component.stop causes the stopping of the target component. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_210303_Stop_test_component_001 { + + type component GeneralComp { } + + function f() runs on GeneralComp { + // wait until component is stopped from outside + while (true) {} + } + + + testcase TC_Sem_210303_Stop_test_component_001() runs on GeneralComp system GeneralComp { + timer t := 1.0; + var GeneralComp ptc; + ptc:=GeneralComp.create; + + ptc.start(f()); + + // wait until component started + t.start; + t.timeout; + + ptc.stop; + + // Test ptc behavior after stop + if (ptc.running==false) + { + setverdict(pass); + } + else + { + setverdict(fail, "Component still running"); + } + + } + + control { + execute(TC_Sem_210303_Stop_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d59e1a88dd03fae8e86ba8e2bd17232a813276d0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451, updated by STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, Ensure that self.stop stops current component + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A component can stop its own behaviour by using a simple stop execution statement +// (see clause 19.9) or by addressing itself in the stop operation, e.g. by using +// the self operation. + +module Sem_210303_Stop_test_component_002 { + + type component GeneralComp { + } + function f() runs on GeneralComp { + var boolean v_cond := true; + if (v_cond) { + setverdict(pass); + self.stop; //stops the ptc + } + setverdict(fail); // in case the stop operation doesn't work + } + + testcase TC_Sem_210303_Stop_test_component_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_210303_Stop_test_component_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d2420fa5d5948d0c32c00de6791de6324c9dd76 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_003.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, stopping MTC from PTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// By using the stop test component statement a test component can stop the execution +// of its own currently running test behaviour or the execution of the test behaviour +// running on another test component. If a component does not stop its own behaviour, +// but the behaviour running on another test component in the test system, the component +// to be stopped has to be identified by using its component reference. +// +// If the stopped test component is the MTC, resources of all existing PTCs shall be +// released, the PTCs shall be removed from the test system and the test case shall +// terminate (see clause 26.1). + +module Sem_210303_Stop_test_component_003 { + + type component GeneralComp { + } + + function f() runs on GeneralComp { + var boolean v_cond := true; + if (v_cond) { // to prevent "unreachable statement" errors + setverdict(pass); + mtc.stop; //stops the MTC and as a consequence the PTC is stopped too + } + setverdict(fail); // in case the stop operation doesn't work + } + + testcase TC_Sem_210303_Stop_test_component_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_ptc.done; + setverdict(fail); // this statement shall never be reached + } + + control { + execute(TC_Sem_210303_Stop_test_component_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a17777dd5daca394c8b8d6c570485cbd88cbc86e --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_004.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, stop.self in MTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A component can stop its own behaviour by using a simple stop execution statement +// (see clause 19.9) or by addressing itself in the stop operation, e.g. by using the +// self operation. +// +// If the stopped test component is the MTC, resources of all existing PTCs shall be +// released, the PTCs shall be removed from the test system and the test case shall +// terminate (see clause 26.1). + +module Sem_210303_Stop_test_component_004 { + + type component GeneralComp { + } + + function f() runs on GeneralComp { + timer t_tmr := 2.0; + t_tmr.start; + t_tmr.timeout; + setverdict(fail); // in case the stop operation doesn't work + } + + testcase TC_Sem_210303_Stop_test_component_004() runs on GeneralComp system GeneralComp { + var boolean v_cond := true; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + if (v_cond) { // to prevent "unreachable statement" errors + setverdict(pass); + self.stop; // stops the MTC and as a consequence the PTC is stopped too + } + setverdict(fail); // this statement shall never be reached + } + + testcase TC_Sem_210303_Stop_test_component_004_next() runs on GeneralComp system GeneralComp { + timer t_tmr := 2.5; + t_tmr.start; + t_tmr.timeout; + setverdict(pass); + } + + control { + execute(TC_Sem_210303_Stop_test_component_004()); + // run another test case to make sure the PTC is not active and doesn't influence its result + execute(TC_Sem_210303_Stop_test_component_004_next()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..93e40cf6352965d235756ef6e15e7c45a23a93db --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_005.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:21.3.3, alive component restart after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Stopping an alive-type component shall stop the currently running behaviour only +// but the component continues to exist and can execute new behaviour (started on +// it using the start operation). + +module Sem_210303_Stop_test_component_005 { + + type component GeneralComp { + } + + function f_ptcBehaviour() runs on GeneralComp { + timer t_tmr := 1.0; + t_tmr.start; + t_tmr.timeout; + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + setverdict(pass); + } + + + testcase TC_Sem_210303_Stop_test_component_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + v_ptc.stop; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + } + + control{ + execute(TC_Sem_210303_Stop_test_component_005()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8df3b827a528f1a5cb4b71ef25ae00d250c823d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_006.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, component variable value reuse in alive component after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Stopping an alive-type component means that all variables, timers and ports +// declared in the component type definition of the alive-type component keep their +// value, contents or state. + +module Sem_210303_Stop_test_component_006 { + + type port P message { + inout charstring; + } + + type component GeneralComp { + var integer vc_val := 0; + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + vc_val := 1; + p.send("PTC started"); + p.receive(charstring:?); // this will never come + setverdict(fail); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (vc_val == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + + testcase TC_Sem_210303_Stop_test_component_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + connect(self:p, v_ptc:p); + v_ptc.start(f_ptcBehaviour()); + p.receive(charstring:?); + v_ptc.stop; + p.send("greetings from the MTC"); + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210303_Stop_test_component_006()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64aa184afb3d8ecc8ed50d9bbfd75e67419735a5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_007.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, timer reuse in alive component after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Stopping an alive-type component means that all variables, timers and ports +// declared in the component type definition of the alive-type component keep their +// value, contents or state. + +module Sem_210303_Stop_test_component_007 { + + type port P message { + inout integer; + } + + type component GeneralComp { + timer tc_tmr := 2.0; + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + tc_tmr.start; + p.send(1); + p.receive(integer:?); + setverdict(fail); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + tc_tmr.timeout; + setverdict(pass); + } + + + testcase TC_Sem_210303_Stop_test_component_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + connect(self:p, v_ptc:p); + v_ptc.start(f_ptcBehaviour()); + p.receive(integer:?); + v_ptc.stop; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + } + + control{ + execute(TC_Sem_210303_Stop_test_component_007()); + } +} + diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e9505d134da7554bc41f32cde947db7125a1d38 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_008.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, port reuse in alive component after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Stopping an alive-type component means that all variables, timers and ports +// declared in the component type definition of the alive-type component keep their +// value, contents or state. + +module Sem_210303_Stop_test_component_008 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + function f_ptcBehaviour() runs on GeneralComp { + connect(self:p1, self:p1); // loopback + connect(mtc:p2, self:p2); // mtc + p1.send(1); + p2.send(2); + p2.receive(integer:?); + setverdict(fail); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + p1.receive(integer:?); + setverdict(pass); + } + + + testcase TC_Sem_210303_Stop_test_component_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + v_ptc.start(f_ptcBehaviour()); + p2.receive(integer:?); + v_ptc.stop; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + } + + control{ + execute(TC_Sem_210303_Stop_test_component_008()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70d789be63b85ed28f0a1c01ff2800784fc0c199 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_009.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.2, verdict value reuse in alive component after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Furthermore, the local verdict of the component keeps its value. + +module Sem_210303_Stop_test_component_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_ptcBehaviour() runs on GeneralComp { + setverdict(pass); + p.send(1); + p.receive(integer:?); + setverdict(fail); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + if (getverdict != pass) { setverdict(fail); } + } + + + testcase TC_Sem_210303_Stop_test_component_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + connect(self:p, v_ptc:p); + v_ptc.start(f_ptcBehaviour()); + p.receive(integer:?); + v_ptc.stop; + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + } + + control{ + execute(TC_Sem_210303_Stop_test_component_009()); + } +} diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..daa3af976e68f280729bd2971ee61c7c72f59de5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_010.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, deactivation of defaults in alive components after explicit stop + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// In contrast to that, all active defaults are automatically deactivated when +// the alive-type component is stopped. + +module Sem_210303_Stop_test_component_010 { + + type port P message { + inout integer; + } + + type component GeneralComp { + timer tc_tmr := 1.0; + port P p; + } + + altstep a_receive() runs on GeneralComp { + [] p.receive(integer:?) { setverdict(fail); } + } + + function f_ptcBehaviour() runs on GeneralComp { + activate(a_receive()); + p.send(1); + p.receive(integer:?); // infinite blocking as MTC doesn't send anything + setverdict(fail); + } + + function f_ptcSecondBehaviour() runs on GeneralComp { + tc_tmr.start; + alt { + [] tc_tmr.timeout { setverdict(pass); } + } + } + + + testcase TC_Sem_210303_Stop_test_component_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC") alive; + connect(self:p, v_ptc:p); + v_ptc.start(f_ptcBehaviour()); + p.receive(integer:?); + v_ptc.stop; + p.send(2); + v_ptc.start(f_ptcSecondBehaviour()); + v_ptc.done; + setverdict(pass); + } + + control{ + execute(TC_Sem_210303_Stop_test_component_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e5a51ee6b388e8b43f685ac2b69c87feef26154 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210303_stop_test_component/Sem_210303_Stop_test_component_011.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, stopping all PTCs + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The all keyword can be used by the MTC only in order to stop all running PTCs but +// the MTC itself. + +module Sem_210303_Stop_test_component_011 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); // infinite blocking + } + + testcase TC_Sem_210303_Stop_test_component_011() runs on GeneralComp system GeneralComp { + var GeneralComp ptc1 := GeneralComp.create, ptc2 := GeneralComp.create; + ptc1.start(f()); + ptc2.start(f()); + all component.stop; + interleave { + [] ptc1.done {} + [] ptc2.done {} + } + setverdict(pass); + } + + control { + execute(TC_Sem_210303_Stop_test_component_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dff8492a8558c527605a6763d8be316f26e44c7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_001.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, restarting explicitly killed non-alive component + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The kill operation applied on a test component stops the execution of the currently +// running behaviour - if any - of that component and frees all resources associated +// to it (including all port connections of the killed component) and removes the +// component from the test system. + +module NegSem_210304_kill_test_component_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_NegSem_210304_kill_test_component_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + ptc.start(f()); + ptc.kill; + ptc.start(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210304_kill_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cde8d71ccc1b60666ee1a666848071a89013eec --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.3, restarting explicitly killed alive component + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The kill operation applied on a test component stops the execution of the currently +// running behaviour - if any - of that component and frees all resources associated +// to it (including all port connections of the killed component) and removes the +// component from the test system. + +module NegSem_210304_kill_test_component_002 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_NegSem_210304_kill_test_component_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create alive; + ptc.start(f()); + ptc.kill; + ptc.start(f()); + setverdict(pass); + } + + control { + execute(TC_NegSem_210304_kill_test_component_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17912e9b7fba70b2cb2188ad994bee0543f8b5f1 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, killing all PTCs from a PTC + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The all keyword can be used by the MTC only in order to stop and kill all running PTCs +// but the MTC itself. + +module NegSem_210304_kill_test_component_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + all component.kill; + } + + testcase TC_NegSem_210304_kill_test_component_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + ptc.start(f()); + ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_210304_kill_test_component_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c37c048f53981176a0c2db1998bb07f4914b5de1 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_004.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, applying kill operation to a variable of a different than component type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable associated with VariableRef (being a component type variable, a component +// type parameter, etc.) or the return type associated with FunctionInstance shall be of +// component type. + +module NegSem_210304_kill_test_component_004 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f_behaviour() runs on GeneralComp { + p.receive(integer:?); // infinite blocking + } + + testcase TC_NegSem_210304_kill_test_component_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc[2]; + v_ptc[0] := GeneralComp.create; + v_ptc[1] := GeneralComp.create; + v_ptc[0].start(f_behaviour()); + v_ptc[1].start(f_behaviour()); + v_ptc.kill; + setverdict(pass); + } + + control { + execute(TC_NegSem_210304_kill_test_component_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66b8567a8bd1bd0b583467736bb3fe6e7d81fc66 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/NegSem_210304_kill_test_component_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, applying kill operation to a function call result of a different than component type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable associated with VariableRef (being a component type variable, a component +// type parameter, etc.) or the return type associated with FunctionInstance shall be of +// component type. + +module NegSem_210304_kill_test_component_005 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type GeneralComp CompArray[2]; + + function f_behaviour() runs on GeneralComp { + p.receive(integer:?); // infinite blocking + } + + function f_createComponents() return CompArray { + var CompArray v_ptc; + v_ptc[0] := GeneralComp.create; + v_ptc[1] := GeneralComp.create; + v_ptc[0].start(f_behaviour()); + v_ptc[1].start(f_behaviour()); + return v_ptc; + } + + testcase TC_NegSem_210304_kill_test_component_005() runs on GeneralComp system GeneralComp { + f_createComponents().kill; + setverdict(pass); + } + + control { + execute(TC_NegSem_210304_kill_test_component_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e49ba931aaab14c2469237ba22a63301f4c093a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_001.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 451, modified by STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, Ensure that kill operator stops a non alive test components. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The kill operation applied on a test component stops the execution of the currently +// running behaviour - if any - of that component and frees all resources associated +// to it (including all port connections of the killed component) and removes the +// component from the test system. +// +// The kill operation can also be applied to another test component. In this case the +// component to be killed shall be addressed using its component reference. + +module Sem_210304_kill_test_component_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_Sem_210304_kill_test_component_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create; + + ptc.start(f()); + ptc.kill; + ptc.killed; + setverdict(pass); + } + + control { + execute(TC_Sem_210304_kill_test_component_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2ba64420c6ab95bbb4880e8bb12122efe222843 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.4, Ensure that all component kill stop all ptcs + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Kill all component (ptc and ptc2) with all component.kill +module Sem_210304_kill_test_component_002 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210304_kill_test_component_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + all component.kill; + + if (all component.alive==false) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210304_kill_test_component_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ae1b9f56ec8141b63b1bdea27686aa9bf591e39 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.4, Ensure that kill operator stops only non alive test components + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Kill only stops non alive test components +module Sem_210304_kill_test_component_003 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210304_kill_test_component_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + ptc.kill; + + + if (match(ptc.alive, false) and match(ptc2.alive, true)) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210304_kill_test_component_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07f1d1aa552250ba121d9932c08ab8259037787f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_004.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 451, modified by STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, Ensure that self kill called in a functions stops non alive test comp. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// non alive test component calls function with self.kill + +module Sem_210304_kill_test_component_004 { + + type component GeneralComp { + timer t; + } + function f() runs on GeneralComp { + self.kill; + setverdict(fail); + } + + + testcase TC_Sem_210304_kill_test_component_004() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create; + + ptc.start(f()); + t.start(5.0); + alt { + [] ptc.killed { setverdict(pass); } + [] t.timeout { setverdict(fail); } + } + } + + control { + execute(TC_Sem_210304_kill_test_component_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..efd4ce7e37c796e4b0a393d29600edae9a9c1368 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_005.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, standalone kill in alive PTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The kill operation can be applied on the current test component itself by a simple +// kill statement or by addressing itself using the self operation in conjunction with +// the kill operation. + + +module Sem_210304_kill_test_component_005 { + + type component GeneralComp { + timer t; + } + + function f() runs on GeneralComp { + var boolean v_bCond := true; + if (v_bCond) { kill; } // to bypass possible "unreachable statement" errors + setverdict(fail); + } + + testcase TC_Sem_210304_kill_test_component_005() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create alive; + + ptc.start(f()); + t.start(5.0); + alt { + [] ptc.killed { setverdict(pass); } + [] t.timeout { setverdict(fail); } + } + } + + control { + execute(TC_Sem_210304_kill_test_component_005()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23142d65666aee4419db5819165b7f13267ce22e --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210304_kill_test_component_operation/Sem_210304_kill_test_component_006.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.4, killing MTC from PTC + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The kill operation can be applied on the current test component itself by a simple +// kill statement or by addressing itself using the self operation in conjunction with +// the kill operation. + + +module Sem_210304_kill_test_component_006 { + + type component GeneralComp { + timer t; + } + + function f() runs on GeneralComp { + var boolean v_bCond := true; + setverdict(pass); + if (v_bCond) { mtc.kill; } // to bypass possible "unreachable statement" errors + setverdict(fail); + } + + testcase TC_Sem_210304_kill_test_component_006() runs on GeneralComp system GeneralComp { + var GeneralComp ptc := GeneralComp.create alive; + + ptc.start(f()); + t.start(5.0); + t.timeout; + setverdict(fail); + } + + control { + execute(TC_Sem_210304_kill_test_component_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e690cf5e37aa82c31efa5820764b29faf943f307 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when any from alive is applied to single component + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction b +// The ComponentArrayRef shall be a reference to a component array variable identifier. +module NegSem_210305_alive_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210305_alive_operation_001() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isAlive := any from v_ptc.alive; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a8ed7044b06113e071e541435d6d878806e7811 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_002.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when any from alive is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210305_alive_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210305_alive_operation_002() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e23bc301af2dcdbada80fe5d35df2de52e765c9c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_003.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when any from alive is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210305_alive_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210305_alive_operation_003() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var float v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cddd463345c8b8c053699b12b696842da4321197 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_004.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210305_alive_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210305_alive_operation_004() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6f33ab7670d91d43376f764d4ec5003cc290cd7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210305_alive_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210305_alive_operation_005() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..132cbd3fe9cfca19cd0549a665c12ab629da237b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSem_210305_alive_operation_006.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.5, partially initialized array in any from ComponentArrayRef.alive + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The ComponentArrayRef shall be a reference to a completely initialized component array. + +module NegSem_210305_alive_operation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_NegSem_210305_alive_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[2]; + v_ptcs[0] := GeneralComp.create alive; + v_ptcs[0].start(f()); + if (any from v_ptcs.alive) { + setverdict(pass); + } + } + + control { + execute(TC_NegSem_210305_alive_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39bab15f139a6e6c3e565616edb21ea6658fae86 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when using index redirection in component.alive operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210305_alive_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210305_alive_operation_001() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isAlive := v_ptc.alive -> @index value v_index; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSyn_210305_alive_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1aa14ef6542517aefff77a0df1302d4e8aa07d7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when using index redirection in any component.alive operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210305_alive_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210305_alive_operation_002() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isAlive := any component.alive -> @index value v_index; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSyn_210305_alive_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3703c36a26be32dfed394b31cc55cc1435c52d3 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_003.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when using index redirection in all component.alive operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210305_alive_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210305_alive_operation_003() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isAlive := all component.alive -> @index value v_index; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSyn_210305_alive_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a458bd098328373038db4caf48a15070da1fae02 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/NegSyn_210305_alive_operation_004.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that error occurs when using index redirection in function instance.alive operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210305_alive_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + function initComp() return GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + return v_ptc; + } + + testcase TC_NegSyn_210305_alive_operation_004() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + var integer v_index; + v_isAlive := initComp().alive -> @index value v_index; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_NegSyn_210305_alive_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45dc4a9038afa7b3674abc5ed1c4b68b4d5c360d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_001.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Testing alive operator with an alive test component + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Alive test component calls a function f1. Afterwards calls f2 function + +module Sem_210305_alive_operation_001 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + function f2 ( integer p_integer ) runs on GeneralComp return integer { + v_gc:=p_integer*p_integer; + return v_gc; + } + testcase TC_Sem_210305_alive_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + ptc.start(f1()); + + ptc.done; + + if (ptc.alive) { + ptc.start(f2(3)); + v_res:=f2(3); +} + + if(v_res==9) + { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210305_alive_operation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a7b9777f2df4b396d550613450ce754c9bd2c11 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Test all component alive operator with alive test components + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//Test all component alive operator in case when two alive test components is already running + +module Sem_210305_alive_operation_002 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210305_alive_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + ptc.done; + + if (all component.alive) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210305_alive_operation_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aee60c4ee88e33943932c35d333e72caf1ae66b4 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Ensure that alive operator gives a correct boolean result + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Two alive test components.ptc killed, than the alive check. +module Sem_210305_alive_operation_003 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210305_alive_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + ptc.kill; + + if (match(ptc.alive, false) and match(ptc2.alive, true)) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210305_alive_operation_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..95d76cbf985ae09408b63e37100f3bf9ce3d9562 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Test any component alive operator with multiple test components + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Any component alive test with two test components. + +module Sem_210305_alive_operation_004 { + + type component GeneralComp { + var integer v_gc:=0; + var integer v_res:=0;} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210305_alive_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + ptc.kill; + + if (any component.alive) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210305_alive_operation_004()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5afd1ff883a5b79038bcefbc5b4aedd8a4a2a61 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_005.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive returns false if no component is alive + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being inactive or running a function from +// innermost to outermost dimension from lowest to highest index for each dimension. The first +// component to be found being inactive or running a function causes the alive operation to +// return the true value. +module Sem_210305_alive_operation_005 { + + type component GeneralComp {} + + testcase TC_Sem_210305_alive_operation_005() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isAlive := any from v_ptc.alive; + if(not v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation incorrectly detected an alive component"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6842e55a4ef83bdc15c056b715b68807b7262bc8 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_006.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive returns true if at least one component is inactive + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being inactive or running a function from +// innermost to outermost dimension from lowest to highest index for each dimension. The first +// component to be found being inactive or running a function causes the alive operation to +// return the true value. +module Sem_210305_alive_operation_006 { + + type component GeneralComp {} + + testcase TC_Sem_210305_alive_operation_006() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + } + v_isAlive := any from v_ptc.alive; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2239e83d62087ee41dea91cc118c9869592907ab --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_007.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive returns true if at least one component is running + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being inactive or running a function from +// innermost to outermost dimension from lowest to highest index for each dimension. The first +// component to be found being inactive or running a function causes the alive operation to +// return the true value. +module Sem_210305_alive_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_007() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9816906279c8fa43e41600a5d52b0fa46297eac9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_008.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive doesn't assign index when no component is alive + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the first component found alive can optionally be assigned to an integer +// variable for single-dimensional component arrays +module Sem_210305_alive_operation_008 { + + type component GeneralComp {} + + testcase TC_Sem_210305_alive_operation_008() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_008(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..771dfa9bb97d7b8542410f940701998b4ddf5c20 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_009.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the first component found alive can optionally be assigned to an integer +// variable for single-dimensional component arrays. +module Sem_210305_alive_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_009() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d52452abacf20824b003f0372d870f9414d2f55f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_010.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive can be used inside expressions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the first component found alive can optionally be assigned to an integer +// variable for single-dimensional component arrays. +module Sem_210305_alive_operation_010 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_010() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate PTC + } + v_isAlive := any from v_ptc.alive -> @index value v_index and v_index == 1; + if(v_isAlive){ + setverdict(pass); + } else { + setverdict(fail, "The any from alive operation didn't find alive components"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ceebd49ecca8fbc1db449e3f8a78f47f412c825 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_011.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_210305_alive_operation_011 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_011() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[2]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd0573608486ac287a590ccbb5b35a6ceb69c778 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_012.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify that any from alive doesn't change index variable when no component is alive + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the first component found alive can optionally be assigned to an integer +// variable for single-dimensional component arrays +module Sem_210305_alive_operation_012 { + + type component GeneralComp {} + + testcase TC_Sem_210305_alive_operation_012() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index := 99; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_012(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_013.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5372053f15d6649cb873b676a1df4cd8e951c074 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_013.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify any from alive index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the alive operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the alive +// operation. +module Sem_210305_alive_operation_013 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_013() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @lazy integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + v_ptc[1].kill; // component at position 1 is killed after the redirect assignment + if(v_index == 1) { // no alive call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_014.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48347fa43e43fe5a50062f453380d67967bf3991 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_014.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Verify any from alive index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the alive operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the alive +// operation. +module Sem_210305_alive_operation_014 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210305_alive_operation_014() runs on GeneralComp system GeneralComp { + var boolean v_isAlive; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @fuzzy integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isAlive := any from v_ptc.alive -> @index value v_index; + v_ptc[1].kill; // component at position 1 is killed after the redirect assignment + if(v_index == 1) { // no alive call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210305_alive_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_015.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e4e2bd480f6d0470c2351afd47aee1af4fa5ae8 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210305_alive_operation/Sem_210305_alive_operation_015.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:21.3.5, Ensure that alive applied on the mtc the operation returns true. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +//// The following requirement is tested: Alive operation applied on the mtc the operation returns true. + +module Sem_210305_alive_operation_015 { + + type component GeneralComp {} + + testcase TC_Sem_210305_alive_operation_015() runs on GeneralComp system GeneralComp { + + if (mtc.alive) { + setverdict(pass); + } + else + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_210305_alive_operation_015()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b2fadc9f6529d1db657da8f845589eff8b376f0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when any from running is applied to single component + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction b +// The ComponentArrayRef shall be a reference to a component array variable identifier. +module NegSem_210306_running_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210306_running_operation_001() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isRunning := any from v_ptc.running; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSem_210306_running_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acc8e481d41b46898bd875b235f41ad390675abb --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_002.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when any from running is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210306_running_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210306_running_operation_002() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSem_210306_running_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9fb587c07fb0252c61dae33ad2145f849f131e86 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_003.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when any from running is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210306_running_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210306_running_operation_003() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var float v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSem_210306_running_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06e86dd2b0704044c3f8625529105f5862807272 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_004.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210306_running_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210306_running_operation_004() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_NegSem_210306_running_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f5c1ad4e613bca765d90f59e3b0abd2edda15bf --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210306_running_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210306_running_operation_005() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_NegSem_210306_running_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c38d347ee966985e456693a478aa55cc7aece46b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSem_210306_running_operation_006.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.6, partially initialized array in any from ComponentArrayRef.running + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The ComponentArrayRef shall be a reference to a completely initialized component array. + +module NegSem_210306_running_operation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.receive(integer:?); + } + + testcase TC_NegSem_210306_running_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[2]; + v_ptcs[0] := GeneralComp.create; + v_ptcs[0].start(f()); + if (any from v_ptcs.running) { + setverdict(pass); + } + } + + control { + execute(TC_NegSem_210306_running_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdfe135a86869067cd09c6e4b698ab752a026080 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when using index redirection in component.running operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210306_running_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210306_running_operation_001() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isRunning := v_ptc.running -> @index value v_index; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSyn_210306_running_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..332d9f0bb3bf39d2d85c92bf3cbc74912c8af139 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when using index redirection in any component.running operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210306_running_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210306_running_operation_002() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isRunning := any component.running -> @index value v_index; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSyn_210306_running_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45c8accade06087ab22ba8e53691b362e017d5e6 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_003.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when using index redirection in all component.running operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210306_running_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210306_running_operation_003() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + v_isRunning := all component.running -> @index value v_index; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSyn_210306_running_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac82332a57dd9a2cf912dd157936d97841122761 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/NegSyn_210306_running_operation_004.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that error occurs when using index redirection in function instance.running operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210306_running_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + function initComp() return GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + return v_ptc; + } + + testcase TC_NegSyn_210306_running_operation_004() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + var integer v_index; + v_isRunning := initComp().running -> @index value v_index; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_NegSyn_210306_running_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36542643d2a0f1af27f43e3e8048e49cec43898c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Check that running operator provides information about test components. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_210306_running_operation_001 { + + type component GeneralComp {} + + function f1 ( ) runs on GeneralComp { + while (true) {} // block forever + } + + testcase TC_Sem_210306_running_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + ptc.stop; + + // Check that ptc is not running, and ptc2 component is running + if (match(ptc.running, false) and match(ptc2.running, true)) { + setverdict(pass); + } else { + setverdict(fail, "either stopped ptc is running or not stopped ptc2 is not running"); + } + } + + control { + execute(TC_Sem_210306_running_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41998ce4d510ee38d5a9cef0c6c40d3c8653e7a7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Any component with running can check the status of the test components + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_210306_running_operation_002 { + + type component GeneralComp {} + + function f1 ( ) runs on GeneralComp { + while (true) {} // block forever + } + + testcase TC_Sem_210306_running_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create; + ptc2:=GeneralComp.create; + + ptc.start(f1()); + ptc2.start(f1()); + + ptc.kill; + + // Any component running test that from two test components at least one is running or not + if (any component.running == true) { //ptc2 running + setverdict(pass); + } else { + setverdict(fail, "ptc2 should still be running"); + } + } + + control { + execute(TC_Sem_210306_running_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c5efbc314325341bccc183f67d90b70ad56ff80 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_003.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running returns false if no component is running + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for executing currently from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// executing causes the running operation to succeed. +module Sem_210306_running_operation_003 { + + type component GeneralComp {} + + testcase TC_Sem_210306_running_operation_003() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isRunning := any from v_ptc.running; + if(not v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation incorrectly detected an running component"); + } + } + + control { + execute(TC_Sem_210306_running_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1099c6c77465836b9e69d8a53911759cc26bac1f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_004.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running returns true if at least one component is running + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for executing currently from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// executing causes the running operation to succeed. +module Sem_210306_running_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_004() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_Sem_210306_running_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe7f1690b7f49c569da08668f717954bb7bc9eef --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_005.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running doesn't assign index when no component is running + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210306_running_operation_005 { + + type component GeneralComp {} + + testcase TC_Sem_210306_running_operation_005() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_005(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..626f0ea21b55732a59ac5193a65eb57146e34fc8 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_006.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running doesn't change index variable when no component is running + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210306_running_operation_006 { + + type component GeneralComp {} + + testcase TC_Sem_210306_running_operation_006() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index := 99; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].kill; + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_006(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0be424e8fccd2705c404147e8860e29cbea1b182 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_007.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210306_running_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_007() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1b0501ff2585d998243f5c61177d7a10b2824c5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_008.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running can be used inside expressions + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210306_running_operation_008 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_008() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate PTC + } + v_isRunning := any from v_ptc.running -> @index value v_index and v_index == 1; + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_Sem_210306_running_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1db7ff65a1ad73ed49d7e4201df4564c9001a76 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_009.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that any from running index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_210306_running_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_009() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[2]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + v_isRunning := any from v_ptc.running -> @index value v_index; + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef659d756228acc0234486f6c9111a7d78cac913 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_010.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify any from running index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the running operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// running operation. +module Sem_210306_running_operation_010 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_010() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @lazy integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running -> @index value v_index; + v_ptc[1].kill; // component at position 1 is killed after the redirect assignment + if(v_index == 1) { // no running call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..089941d04d7357378e2b8faa1ddc6e8d4b19dce2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_011.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify any from running index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the running operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// running operation. +module Sem_210306_running_operation_011 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_011() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @fuzzy integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + v_isRunning := any from v_ptc.running -> @index value v_index; + v_ptc[1].kill; // component at position 1 is killed after the redirect assignment + if(v_index == 1) { // no running call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210306_running_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dcb0b80f32c39e6d62526ef6b8614fe7a2dcc315 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_012.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Verify that all component.running produces true if some components haven't been started + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the all keyword is used with the running operation, it will return true if all PTCs started +// but not stopped explicitly by another component are executing their behaviour. Otherwise it +// returns false. +// Interpretation according to the following note: +// The difference between the running operation applied to a single ptc and the usage of the all +// keyword leads to the situation that ptc.running is false if the ptc has never been started but +// all component.running is true at the same time as it considers only those components that ever +// have been started. +module Sem_210306_running_operation_012 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210306_running_operation_012() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 1) { v_ptc[i].start(f());} // start only components with odd index + } + v_isRunning := all component.running; // only once started components shall be considered + if(v_isRunning){ + setverdict(pass); + } else { + setverdict(fail, "The any from running operation didn't find running components"); + } + } + + control { + execute(TC_Sem_210306_running_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_013.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..63e4901a561b16ccafb35477d97145719bd4d84c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210306_running_operation/Sem_210306_running_operation_013.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:21.3.6, Check that running operator provides information about mtc. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// // The following requirement is tested: The running operation returns true for the mtc and PTCs that have been started but not yet terminated or stopped. + +module Sem_210306_running_operation_013 { + + type component GeneralComp {} + + function f1 ( ) runs on GeneralComp { + while (true) {} // block forever + } + + testcase TC_Sem_210306_running_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + ptc:=GeneralComp.create alive; + + ptc.start(f1()); + + // Check that ptc is running, and mtc component is running + if (match(ptc.running, true) and match(mtc.running, true)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_210306_running_operation_013()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..211891e8d5e023f03aef688fca3b4d17b7162a87 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_001.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Ensure that done operator can be used only for ptcs. + ** @verdict pass reject + *****************************************************************/ +// Done operator can be used only for ptcs, not for mtcs. + +module NegSem_210307_done_operation_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_NegSem_210307_done_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + + GeneralComp.done; // not allowed. Done only allowed for ptcs. + + } + + control { + execute(TC_NegSem_210307_done_operation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81bc778d0bd7a3cac463d3901ef5374f89eaab26 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when any from done is applied to single component + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The ComponentArrayRef shall be a reference to a component array variable identifier. +module NegSem_210307_done_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210307_done_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] any from v_ptc.done { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSem_210307_done_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f26e8bd0d1fb54e7f4781f0e484ff07f7898b4ff --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_003.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when any from done is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210307_done_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210307_done_operation_003() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + alt + { + [] any from v_ptc.done -> @index value v_index + { + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSem_210307_done_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4671d3dcab0faa71c021378cac5b272793787baf --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_004.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when any from done is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210307_done_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210307_done_operation_004() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var float v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + alt + { + [] any from v_ptc.done -> @index value v_index + { + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSem_210307_done_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fdd32aadb2db7b5b8b9e2ac8cb3c5b754d9cc3f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_005.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction f: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210307_done_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210307_done_operation_005() runs on GeneralComp system GeneralComp { + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + alt + { + [] any from v_ptc.done -> @index value v_index + { + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSem_210307_done_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ceb586f19e663aaa78c06f2b0d983a55412c82eb --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_006.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction f: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210307_done_operation_006 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210307_done_operation_006() runs on GeneralComp system GeneralComp { + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + alt + { + [] any from v_ptc.done -> @index value v_index + { + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSem_210307_done_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c9a9ca505007ddf63ae8c3da426197deb721a5d0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_007.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, variable of incorrect type used for storing verdict in done operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable used in the (optional) value clause for storing the final local verdict +// of a PTC shall be of the type verdicttype. + +module NegSem_210307_done_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210307_done_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var boolean v_verdict; + v_ptc.start(f()); + alt { + [] v_ptc.done -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210307_done_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe961cebb9c67eded96f48aa063df45d19fcca6c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_008.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, storing verdict in any component.done operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The (optional) value clause for storing the final local verdict of a PTC shall not be used +// in combination with all component or any component. + +module NegSem_210307_done_operation_008 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210307_done_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] any component.done -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210307_done_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e9f63e92539703971801cc55941fa3e6d9054bc --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_009.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, storing verdict in all component.done operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The (optional) value clause for storing the final local verdict of a PTC shall not be used +// in combination with all component or any component. + +module NegSem_210307_done_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210307_done_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] all component.done -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210307_done_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd1eb1ca97a8bddd80881c8182ef445f371c4cc0 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSem_210307_done_operation_010.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, partially initialized array in any from ComponentArrayRef.done + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The ComponentArrayRef shall be a reference to a completely initialized component array. + +module NegSem_210307_done_operation_010 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210307_done_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[2]; + var verdicttype v_verdict; + v_ptcs[0] := GeneralComp.create; + v_ptcs[0].start(f()); + alt { + [] any from v_ptcs.done { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210307_done_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78915fb318f720f189f4c7a2b98ee66682e8a5ca --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when using index redirection in component.done operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210307_done_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210307_done_operation_001() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] v_ptc.done -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSyn_210307_done_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68f576cb21b32b7c496e955d3cb406b3b1db7104 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when using index redirection in any component.done operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210307_done_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210307_done_operation_002() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] any component.done -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSyn_210307_done_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a4d78c2092933f01e6194f258aa783d8a2e147b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_003.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when using index redirection in all component.done operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210307_done_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210307_done_operation_003() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] all component.done -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSyn_210307_done_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bf61bd3a7e64a358a573fe818b11a971d1a6e02 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/NegSyn_210307_done_operation_004.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that error occurs when using index redirection in function instance.done operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210307_done_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + function f_getComp(GeneralComp p_ptc) return GeneralComp { + return p_ptc; + } + + testcase TC_NegSyn_210307_done_operation_004() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + alt + { + [] any from f_getComp(v_ptc).done -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't find done components"); } + } + } + + control { + execute(TC_NegSyn_210307_done_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db40d4bf0207f889465fb33141ade8085e466a4f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Ensure that all component with done can check that at least one test component is not done + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Any component done to check that two test component finished. + +module Sem_210307_done_operation_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210307_done_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + all component.done; + + alt { + [] all component.done {setverdict(pass);} + } + + + } + + control { + execute(TC_Sem_210307_done_operation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7bdeddf80a7691dcbd43d7629bed026a0075394 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_002.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done is not triggered if no component has been started + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being stopped or killed from innermost to +// outermost dimension from lowest to highest index for each dimension. The first component to +// be found stopped or killed causes the done operation to succeed. +module Sem_210307_done_operation_002 { + + type component GeneralComp {} + + testcase TC_Sem_210307_done_operation_002() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + } + alt + { + [] any from v_ptc.done { setverdict(fail, "The any from done operation found stopped or killed component"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_210307_done_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d8e91fb505dbb11ec95bf8b21809515711407af --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_003.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done matches if at least one component is stopped or killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for executing currently from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// executing causes the done operation to succeed. +module Sem_210307_done_operation_003 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_003() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 3) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.done { setverdict(pass); } + [else] { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..068795145ee37142ee12dcafb32ab08b9d0234db --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_004.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done doesn't assign index when no component has been stopped or killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210307_done_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_004() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.done -> @index value v_index { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + [else] { setverdict(pass); } + } + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210307_done_operation_004(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..70e475f581c7e2d56f5868b38c63c910dd5b9661 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_005.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done doesn't change index variable when no component has been stopped or killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210307_done_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_005() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index := 99; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.done -> @index value v_index { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + [else] { setverdict(pass); } + } + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210307_done_operation_005(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20508e5971de577a642577849a750700a20f1d09 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_006.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210307_done_operation_006 { + + type component GeneralComp {} + + function f(float f_time) runs on GeneralComp { + timer t := f_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_006() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.done -> @index value v_index { + if(v_index == 2){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddb1fab1ff9e8dc3b452f8ecd62fff8eab0e5ec2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_007.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done is not triggered if all components are executing function + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being stopped or killed from innermost to +// outermost dimension from lowest to highest index for each dimension. The first component to +// be found stopped or killed causes the done operation to succeed. +module Sem_210307_done_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_007() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.done { setverdict(fail, "The any from done operation found stopped or killed component"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_210307_done_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9877849f604db0880c1c455e065586d0d109767f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_008.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that any from done index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_210307_done_operation_008 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_008() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[2]; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i == 2 and j == 1) { v_ptc[i][j].start(f(1.0)); } + else { v_ptc[i][j].start(f(100.0));} // activate v_ptc + } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.done -> @index value v_index { + if(v_index[0] == 2 and v_index[1] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b54adbffbcdd48bc7a48d4fc7ba7ad4a4ff4428 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_009.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify any from done index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the done operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// done operation. +module Sem_210307_done_operation_009 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_009() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @lazy integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.done -> @index value v_index { + v_ptc[0].kill; // component at position 0 is killed after the redirect assignment + if(v_index == 2){ // no done call during evaluation, v_index remains equal to 2 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8682b80d801f6e306e7ed727f170b469e5b2e25 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_010.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify any from done index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the done operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// done operation. +module Sem_210307_done_operation_010 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_010() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @fuzzy integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.done -> @index value v_index { + v_ptc[0].kill; // component at position 0 is killed after the redirect assignment + if(v_index == 2){ // no done call during evaluation, v_index remains equal to 2 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from done operation didn't found stopped or killed component"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47a25863c2ab126ebda0bc75c6c5c54912cd1d99 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_011.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.7, Verify that all component.done produces true if some components haven't been started + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the all keyword is used with the done operation, it matches if no one PTC is executing its +// behaviour. It also matches if no PTC has been created. +// Interpretation according to the following note: +// The difference between the done operation applied to a single ptc and the usage of the all +// keyword leads to the situation that ptc.done does not match if the ptc has never been started +// but all component.done matches at the same time as it considers only those components that +// ever have been started . +module Sem_210307_done_operation_011 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210307_done_operation_011() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 4; + var GeneralComp v_ptc := GeneralComp.create; + alt { + [] v_ptc.done { setverdict(fail, "PTC is not done yet (it actually hasn't been started yet)" )} + [] all component.done { setverdict(pass); } + [else] { setverdict(fail, "all component.done wasn't triggered"); } + } + } + + control { + execute(TC_Sem_210307_done_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..048e7dd44f20cc8e6801d92a76ba5dc058de169c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210307_done_operation/Sem_210307_done_operation_012.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, storing verdict in done operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When the done operation is applied to a PTC and matches, the final local verdict of the PTC +// can be retrieved and stored in variable of the type verdicttype. This is denoted by the +// symbol '->' the keyword value followed by the name of the variable into which the verdict +// is stored. + +module Sem_210307_done_operation_012 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_210307_done_operation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] v_ptc.done -> value v_verdict { + if (v_verdict != pass) { setverdict(fail, "Invalid PTC verdict"); } + } + } + } + + control { + execute(TC_Sem_210307_done_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71f7c1d38d48c369d2290aa78aa0b88665ed23e6 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_001.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Ensure that killed operator is only valid for ptcs. + ** @verdict pass reject + *****************************************************************/ +// killed operator is not allowed for mtc check. + +module NegSem_210308_killed_operation_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_NegSem_210308_killed_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + + mtc.kill; + + alt { + [] any component killed {setverdict(pass);} // not allowed. killed only allowed for ptcs. + } + } + + control { + execute(TC_NegSem_210308_killed_operation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21aea66528ab477c6486d7a51a55994b80b5cac6 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_002.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when any from killed is applied to single component + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction b +// The ComponentArrayRef shall be a reference to a component array variable identifier. +module NegSem_210308_killed_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210308_killed_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.kill; + alt + { + [] any from v_ptc.killed { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..991b7e4176e7908f18aa3b3c88d06f9944a248cf --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_003.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when any from killed is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210308_killed_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210308_killed_operation_003() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + alt + { + [] any from v_ptc.killed -> @index value v_index + { + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3460b503dcc12a892b41f37944af0fed333615af --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_004.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when any from killed is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction d +// If the index redirection is used for single-dimensional component arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_210308_killed_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210308_killed_operation_004() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var float v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0) { v_ptc[i].kill; } // kill components on even indices + else { v_ptc[i].start(f());} // activate v_ptc + } + alt + { + [] any from v_ptc.killed -> @index value v_index + { + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5516a3b1d1334d0ba72b36c1e59a7364e05b3a2 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_005.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210308_killed_operation_005 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210308_killed_operation_005() runs on GeneralComp system GeneralComp { + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[1]; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + alt + { + [] any from v_ptc.killed -> @index value v_index + { + if(v_index[0] == 1 and v_index[1] == 0){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2b536a4c73cbdaa1e0e6b60ff04761a2e826fe9 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_006.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_210308_killed_operation_006 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_NegSem_210308_killed_operation_006() runs on GeneralComp system GeneralComp { + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create; // created components are inactive + if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j + else { v_ptc[i][j].start(f());} // activate v_ptc + } + } + alt + { + [] any from v_ptc.killed -> @index value v_index + { + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Invalid index value"); + } + setverdict(pass); + } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0c082b41982d2bff6636a1081461e69a84f739f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_007.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.8, variable of incorrect type used for storing verdict in killed operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable used in the (optional) value clause for storing the final local verdict +// of a PTC shall be of the type verdicttype. + +module NegSem_210308_killed_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210308_killed_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var boolean v_verdict; + v_ptc.start(f()); + alt { + [] v_ptc.killed -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7ec6d0454d0f71a8e6adea09b17a26c6d3f8385 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_008.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.8, storing verdict in any component.killed operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The (optional) value clause for storing the final local verdict of a PTC shall not be used +// in combination with all component or any component. + +module NegSem_210308_killed_operation_008 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210308_killed_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] any component.killed -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a93723325a9f2ac79861c13d605dc718f67ed445 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_009.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.8, storing verdict in all component.killed operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The (optional) value clause for storing the final local verdict of a PTC shall not be used +// in combination with all component or any component. + +module NegSem_210308_killed_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210308_killed_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] all component.killed -> value v_verdict { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210308_killed_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e6532495e8e933f1380dde802f2ffe4d1e6c856 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSem_210308_killed_operation_010.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.7, partially initialized array in any from ComponentArrayRef.killed + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The ComponentArrayRef shall be a reference to a completely initialized component array. + +module NegSem_210307_done_operation_010 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_NegSem_210307_done_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[2]; + var verdicttype v_verdict; + v_ptcs[0] := GeneralComp.create; + v_ptcs[0].start(f()); + alt { + [] any from v_ptcs.killed { + setverdict(pass); + } + } + } + + control { + execute(TC_NegSem_210307_done_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ece700b0f64eb22d402061c200e7d22a6de162f --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when using index redirection in component.killed operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210308_killed_operation_001 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210308_killed_operation_001() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] v_ptc.killed -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSyn_210308_killed_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74d0d94e8277c99d7281186df881b1683d772e62 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when using index redirection in any component.killed operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210308_killed_operation_002 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210308_killed_operation_002() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] any component.killed -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSyn_210308_killed_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f296300a833f2af666b4537bdc9313cc915a408d --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_003.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when using index redirection in all component.killed operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210308_killed_operation_003 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_NegSyn_210308_killed_operation_003() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + v_ptc.start(f()); + alt + { + [] all component.killed -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSyn_210308_killed_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..081a0d7c43ec0e3b7202b55baefa670b1a0313a7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/NegSyn_210308_killed_operation_004.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that error occurs when using index redirection in function instance.killed operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction c +// The index redirection shall only be used when the operation is used on an any from +// component array construct. +module NegSyn_210308_killed_operation_004 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + function f_getComp(GeneralComp p_ptc) return GeneralComp { + return p_ptc; + } + + testcase TC_NegSyn_210308_killed_operation_004() runs on GeneralComp system GeneralComp { + var integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + alt + { + [] any from f_getComp(v_ptc).killed -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't find killed components"); } + } + } + + control { + execute(TC_NegSyn_210308_killed_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_001.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8e7e946a88f39cb332201b08372232436cd1f22 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Ensure that all component kill can be checked with killed operator + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// all components are killed, than check the status with killed operator + +module Sem_210308_killed_operation_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210308_killed_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + all component.kill; + + alt { + [] all component.killed {setverdict(pass);} + } + + + } + + control { + execute(TC_Sem_210308_killed_operation_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_002.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..effba159a6cb77956acccceb039c9333532c8a6b --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.8, check that any component and killed operator can check that at least one test component is running or not + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// Check that at least one test component is still running or not +module Sem_210308_killed_operation_002 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210308_killed_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create alive; + + ptc.start(f1()); + ptc2.start(f1()); + + ptc.kill; + + alt { + [] any component.killed {setverdict(pass);} + } + + + } + + control { + execute(TC_Sem_210308_killed_operation_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_003.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2b0263f8493ee1aae3cafc4bcbc209b7062c267 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_003.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Ensure that the alive keyword is properly evaluated + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_210308_killed_operation_003 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_210308_killed_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp ptc; + var GeneralComp ptc2; + ptc:=GeneralComp.create alive; + ptc2:=GeneralComp.create; + + ptc.start(f1()); + ptc2.start(f1()); + + ptc.stop; + ptc2.stop; + + alt { + [] all component.killed {setverdict(fail);} //ptc is alive only kill stops it + [] ptc2.killed {setverdict(pass);} + } + + + } + + control { + execute(TC_Sem_210308_killed_operation_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_004.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78ed25287f14acad8b87a3eef766463b93ebaf91 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_004.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed is not triggered if no component has been started + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being killed from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// killed causes the killed operation to succeed. +module Sem_210308_killed_operation_004 { + + type component GeneralComp {} + + testcase TC_Sem_210308_killed_operation_004() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + } + alt + { + [] any from v_ptc.killed { setverdict(fail, "The any from killed operation found killed component"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_005.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..191759ccbbc67ab8d8f6569779d6867f5bdc53a5 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_005.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed matches if at least one component is stopped or killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being killed from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// killed causes the killed operation to succeed. +module Sem_210308_killed_operation_005 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_005() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; + if (i == 3) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed { setverdict(pass); } + [else] { setverdict(fail, "The any from killed operation didn't found killed component"); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_006.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..461c58649646e328ef6b260392bcbb26a0cf1812 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_006.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed doesn't assign index when no component has been killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210308_killed_operation_006 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_006() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create alive; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.killed -> @index value v_index { setverdict(fail, "The any from killed operation didn't found killed component"); } + [else] { setverdict(pass); } + } + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210308_killed_operation_006(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_007.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35ffc8923eccd915a00e89291b8baf542f24dcbf --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_007.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed doesn't change index variable when no component has been killed + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210308_killed_operation_007 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_007() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index := 99; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create alive; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.killed -> @index value v_index { setverdict(fail, "The any from killed operation didn't found killed component"); } + [else] { setverdict(pass); } + } + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_210308_killed_operation_007(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_008.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58f5f8aaf8360cb80085890242015a161ad9b9f7 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_008.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The index of the matched component can optionally be assigned to an integer variable +// for single-dimensional component arrays... +module Sem_210308_killed_operation_008 { + + type component GeneralComp {} + + function f(float f_time) runs on GeneralComp { + timer t := f_time; + t.start; + t.timeout; + kill; + } + + testcase TC_Sem_210308_killed_operation_008() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create alive; + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed -> @index value v_index { + if(v_index == 2){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from killed operation didn't found killed component"); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_009.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e00820cd6d15e398c1cac74a777621ce5fa66c9c --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_009.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed is not triggered if all components are executing function + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being killed from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// killed causes the killed operation to succeed. +module Sem_210308_killed_operation_009 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 100.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_009() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create alive; + v_ptc[i].start(f()); + } + alt + { + [] any from v_ptc.killed { setverdict(fail, "The any from killed operation found killed component"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_010.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dfdceab1a41b2ff8a0cbdcbe597dbb5cd73fd10 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_010.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction d: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_210308_killed_operation_010 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + kill; + } + + testcase TC_Sem_210308_killed_operation_010() runs on GeneralComp system GeneralComp { + var boolean v_isRunning; + const integer c_size := 3; + var GeneralComp v_ptc[c_size][c_size]; + var integer v_index[2]; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + for (var integer j := 0; j < c_size; j := j + 1) { + v_ptc[i][j] := GeneralComp.create alive; // created components are inactive + if (i == 2 and j == 1) { v_ptc[i][j].start(f(1.0)); } + else { v_ptc[i][j].start(f(100.0));} // activate v_ptc + } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed -> @index value v_index { + if(v_index[0] == 2 and v_index[1] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from killed operation didn't found killed component"); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_011.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b7340f74298a6da5897770437c0273366953c62 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_011.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify any from killed index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the killed operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// killed operation. +module Sem_210308_killed_operation_011 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_011() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @lazy integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed -> @index value v_index { + v_ptc[0].kill; // component at position 0 is killed after the redirect assignment + if(v_index == 2){ // no killed call during evaluation, v_index remains equal to 2 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from killed operation didn't found killed component"); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_012.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ea2485edc17d41e0198e5fec7b516478a06ff43 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_012.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify any from killed index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the killed operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// killed operation. +module Sem_210308_killed_operation_012 { + + type component GeneralComp {} + + function f(float p_time) runs on GeneralComp { + timer t := p_time; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_012() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + var @fuzzy integer v_index; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create; // created components are inactive + if (i == 2) { v_ptc[i].start(f(1.0)); } + else { v_ptc[i].start(f(100.0)); } + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed -> @index value v_index { + v_ptc[0].kill; // component at position 0 is killed after the redirect assignment + if(v_index == 2){ // no killed call during evaluation, v_index remains equal to 2 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from killed operation didn't found killed component"); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_013.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cdf82737e6737dd4743e9099c5e545f32ea5d63 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_013.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:21.3.8, Verify that any from killed is not triggered if when alive component has stopped execution + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// When the any from component array notation is used, the components from the referenced array +// are iterated over and individually checked for being killed from innermost to outermost +// dimension from lowest to highest index for each dimension. The first component to be found +// killed causes the killed operation to succeed. +module Sem_210308_killed_operation_013 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + timer t := 1.0; + t.start; + t.timeout; + } + + testcase TC_Sem_210308_killed_operation_013() runs on GeneralComp system GeneralComp { + const integer c_size := 4; + var GeneralComp v_ptc[c_size]; + timer t := 2.0; + for (var integer i := 0; i < c_size; i := i + 1) { + v_ptc[i] := GeneralComp.create alive; + v_ptc[i].start(f()); + } + t.start; + t.timeout; + alt + { + [] any from v_ptc.killed { setverdict(fail, "The any from killed operation found killed component"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_210308_killed_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_014.ttcn b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e01ff8bf2a281da3fb210e9ef69a586a8bb0312a --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210308_killed_operation/Sem_210308_killed_operation_014.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:21.3.8, storing verdict in killed operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When the killed operation is applied to a PTC and matches, the final local verdict of the PTC +// can be retrieved and stored in variable of the type verdicttype. This is denoted by the +// symbol '->' the keyword value followed by the name of the variable into which the verdict +// is stored. + +module Sem_210308_killed_operation_014 { + + type component GeneralComp {} + + function f() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_210308_killed_operation_014() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var verdicttype v_verdict; + v_ptc.start(f()); + alt { + [] v_ptc.killed -> value v_verdict { + if (v_verdict != pass) { setverdict(fail, "Invalid PTC verdict"); } + } + } + } + + control { + execute(TC_Sem_210308_killed_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/21_configuration_operations/2103_test_component_operations/210309_any_and_all_components/NOTES b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210309_any_and_all_components/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..0dd0cba154d6eac5be518c2f0d36d612c7303e02 --- /dev/null +++ b/ATS/core_language/21_configuration_operations/2103_test_component_operations/210309_any_and_all_components/NOTES @@ -0,0 +1 @@ +Test cases using all and any keywords are already present in preceding subsections of 21.03. \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97662bfddcde347e9e4da83601e508475f16fa38 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_001.ttcn @@ -0,0 +1,104 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass reject + ***************************************************/ + +module NegSem_220201_SendOperation_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220201_SendOperation_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + template MessageType mw_sendingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=*,b:=2,c:=true}, + field7 := {a:=1,b:=*,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(mw_sendingTemplate); //can only send specific values + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_220201_SendOperation_001()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6341dc46b459d6c17552eb6c1ac63beab9b0a8b1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_002.ttcn @@ -0,0 +1,104 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass reject + ***************************************************/ + +module NegSem_220201_SendOperation_002 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220201_SendOperation_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + template MessageType mw_sendingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=?,b:=2,c:=true}, + field7 := {a:=1,b:=?,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(mw_sendingTemplate); //can only send specific values + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_220201_SendOperation_002()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a4bed08bbdee0268df7c749bbc0f6a1bebf61e1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass reject + ***************************************************/ + +module NegSem_220201_SendOperation_003 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220201_SendOperation_003() runs on GeneralComp { + + + messagePort.send(float:2.0); //sent type does not match port specification + + alt { + [] messagePort.receive(2) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_220201_SendOperation_003()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..983057b114a9d1e49ca9780c319397df705170eb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_004.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220201_SendOperation_004 { + +signature p_NegSem_220201_SendOperation_004(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + +template p_NegSem_220201_SendOperation_004 s_baseTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := ? +} + +template p_NegSem_220201_SendOperation_004 s_returnTemplate modifies s_baseTemplate := { + p_par3 := 5 +} + +template p_NegSem_220201_SendOperation_004 s_wrongTemplate modifies s_baseTemplate := { + p_par3 := 3 +} + +template p_NegSem_220201_SendOperation_004 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 +} + + type port remotePort procedure { + out p_NegSem_220201_SendOperation_004; + } + +type component GeneralComp { + port remotePort PCO; +} + +testcase NegSem_220201_SendOperation_004() runs on GeneralComp { + + PCO.send(p_NegSem_220201_SendOperation_004:s_callTemplate, 5.0) { //cannot use send operation on a procedure based port + + [] PCO.getreply(p_NegSem_220201_SendOperation_004:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220201_SendOperation_004:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220201_SendOperation_004:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } +} + +control{ + execute(NegSem_220201_SendOperation_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7954aa5c08db94e7bb090dec351fc1fce72eb789 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_005.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, missing to clause in case of one-to-many connections + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Unicast, multicast and broadcast communication can be determined by the optional to clause +// in the send operation. A to clause can be omitted in case of a one-to-one connection where +// unicast communication is used and the message receiver is uniquely determined by the test +// system structure. +// A to clause shall be present in case of one-to-many connections. + +module NegSem_220201_SendOperation_005 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + alt { + [] p.receive(p_expected) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } + + const integer c_ptcCount := 2; + + testcase TC_NegSem_220201_SendOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(0)); + } + p.send(0); + all component.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c9caf6cafe74c3d01ab7e41dd1571aa9e33d499 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_006.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, partially initialized template + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The TemplateInstance (and all parts of it) shall have a specific value i.e. the use +// of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220201_SendOperation_006 { + + type record of integer RoI; + + type port P message { + inout RoI; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_006() runs on GeneralComp { + var template RoI vm_msg := {1, -, 2}; + p.send(vm_msg); + p.receive; + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea3f8bbc99b6388bb4e3c5941dd3c842034bc777 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_007.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, no type prefix in inline template + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When defining the message in-line, the optional type part shall be used if there is +// ambiguity of the type of the message being sent. + + +module NegSem_220201_SendOperation_007 { + + type record R1 + { + integer field1, + integer field2 + } + + type record of integer RoI; + + type port P message { + inout R1, RoI; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_007() runs on GeneralComp { + p.send({1, 2}); + p.receive; + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_008.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b22e5b297ec3e72e1e871fcbfe61a08dde6aa9a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_008.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.1, incompatible address value in send operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// All AddressRef items in the to clause shall be of type address, component or of the +// address type bound to the port type (see clause 6.2.9) of the port instance referenced +// in the send operation. + +module NegSem_220201_SendOperation_008 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_008() runs on GeneralComp { + p.send(1) to "127.0.0.1"; + p.receive(integer:?); + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_009.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75dc3edd25d4792de7527d7421782f3a55364b0c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_009.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.1, null address in the to clause of send operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220201_SendOperation_009 { + + type port P message { + inout integer; + } + + type integer address; + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_009() runs on GeneralComp { + var address v_addr := null; + p.send(1) to v_addr; + p.receive(integer:?); + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_010.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b70f5a35b1239dc02cf4b732577ce1e713d75493 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_010.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.1, null component in the to clause of send operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220201_SendOperation_010 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_comp := null; + connect(self:p, self:p); + p.send(0) to v_comp; + p.receive(integer:?); + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_011.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6acabc06c773230d73c0d024393db297aad78b07 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/NegSem_220201_SendOperation_011.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, send operation on disconnected and unmapped ports + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Applying a send operation to an unmapped or disconnected port shall cause a test case +// error. + +module NegSem_220201_SendOperation_011 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220201_SendOperation_011() runs on GeneralComp system GeneralComp { + p.send(0); + setverdict(pass); + } + + control { + execute(TC_NegSem_220201_SendOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db11f94a0dcbddc1dc49550653759112ef9f1dd5 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_001.ttcn @@ -0,0 +1,104 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220201_SendOperation_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220201_SendOperation_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + template MessageType mw_sendingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(mw_sendingTemplate); //can send also template with specific values + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220201_SendOperation_001()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8622a9ad1a75a42034d9941e580d78e27d8bc576 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_002.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220201_SendOperation_002 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220201_SendOperation_002() runs on GeneralComp { + + + messagePort.send(2); //can send also in-line template + + alt { + [] messagePort.receive(2) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220201_SendOperation_002()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..16bffe3751a90d64cdd2ee3251f4932a290a9a0f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_003.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220201_SendOperation_003 { + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type port loopbackPort message { + inout RecordType, SetType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220201_SendOperation_003() runs on GeneralComp { + + + messagePort.send(RecordType:{1,2,true}); //can send also in-line template + + alt { + [] messagePort.receive(RecordType:{1,2,true}) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220201_SendOperation_003()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c375ee27ad98021690fed8d371a8796094a5bd79 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_004.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.1, Ensure that the IUT correctly handles message sending operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220201_SendOperation_004 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220201_SendOperation_004() runs on GeneralComp { + var integer v_1:=2, v_2:=3; + + messagePort.send(v_1*v_2+1); //can send also the results of operations + + alt { + [] messagePort.receive(7) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220201_SendOperation_004()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..609ef00c08e3c18687a2c4ca71bae4e434a92dd5 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_005.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, unicast send operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Unicast communication is specified, if the to clause addresses one communication partner +// only. + +module Sem_220201_SendOperation_005 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + alt { + [] p.receive(p_expected) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } + + const integer c_ptcCount := 2; + + testcase TC_Sem_220201_SendOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(i)); + } + p.send(0) to v_ptcs[0]; + p.send(1) to v_ptcs[1]; + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220201_SendOperation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da082079b2f21d0afc83b0b7301fe3478918b1f2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_006.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, multicast send operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Multicast communication is used, if the to clause includes a list of communication +// partners. + +module Sem_220201_SendOperation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + alt { + [] p.receive(p_expected) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } + + const integer c_ptcCount := 4; + + testcase TC_Sem_220201_SendOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(i mod 2)); + } + p.send(0) to (v_ptcs[0], v_ptcs[2]); + p.send(1) to (v_ptcs[1], v_ptcs[3]); + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220201_SendOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..edb52391adad36132f6db02b1d36afd4a7560975 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220201_send_operation/Sem_220201_SendOperation_007.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.1, broadcast send operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Broadcast is defined by using the to clause with all component keyword. + +module Sem_220201_SendOperation_007 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + alt { + [] p.receive(p_expected) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220201_SendOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(0)); + } + p.send(0) to all component; + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220201_SendOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02cd81a5c399105211b087c3abc483fbca8af50c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_001.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220202_ReceiveOperation_001 { + +signature p_NegSem_220202_ReceiveOperation_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + +template p_NegSem_220202_ReceiveOperation_001 s_baseTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := ? +} + +template p_NegSem_220202_ReceiveOperation_001 s_returnTemplate modifies s_baseTemplate := { + p_par3 := 5 +} + +template p_NegSem_220202_ReceiveOperation_001 s_wrongTemplate modifies s_baseTemplate := { + p_par3 := 3 +} + +template p_NegSem_220202_ReceiveOperation_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 +} + + type port remotePort procedure { + out p_NegSem_220202_ReceiveOperation_001; + } + +type component GeneralComp { + port remotePort PCO; +} + +testcase NegSem_220202_ReceiveOperation_001() runs on GeneralComp { + + PCO.call(p_NegSem_220202_ReceiveOperation_001:s_callTemplate, 5.0) { + + [] PCO.receive(p_NegSem_220202_ReceiveOperation_001:s_wrongTemplate value 1) { //cannot receive from procedure based port + setverdict(fail); + } + [] PCO.receive(p_NegSem_220202_ReceiveOperation_001:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.receive(p_NegSem_220202_ReceiveOperation_001:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } +} + +control{ + execute(NegSem_220202_ReceiveOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b35c07ddf7c91f1a145fda46e94c64b26fdb391f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_002.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, no type prefix in ambiguous inline template + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// An optional type field in the matching criteria to the receive operation shall +// be used to avoid any ambiguity of the type of the value being received. + +module NegSem_220202_ReceiveOperation_002 { + + type record of integer RoI; + type record R { + integer field1, + integer field2 + } + + type port P message { + inout R, RoI; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_002() runs on GeneralComp { + p.send(R:{1, 2}); + alt { + [] p.receive({?, 2}) { setverdict(pass); } // error (ambiguous type) + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3ff412585424669e6432958307006d292ea5bdd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_003.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, type mismatch in redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable or formal parameter shall be type compatible with the received message. + +module NegSem_220202_ReceiveOperation_003 { + + type port P message { + inout integer, charstring; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_003() runs on GeneralComp { + var charstring v_str; + p.send(1); + alt { + [] p.receive(integer:?) -> value v_str { setverdict(pass); } // error (type mismatch in redirect assignment) + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e3252964d365738bac65f9da6f2c326fba10fbd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_004.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, type mismatch in redirect assignment of message fields + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The variable or formal parameter shall be type compatible with the type on the +// right hand side of the assignment symbol. + +module NegSem_220202_ReceiveOperation_004 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_004() runs on GeneralComp { + var integer v_int; + var bitstring v_str; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.receive(R:?) -> value ( v_int := field1[1], v_str := field2) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f29c7bc44cf7f950a570780bdf74e9fbb6aba27 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, applying @decoded to a forbidden field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220202_ReceiveOperation_005 { + type record R + { + integer id, + record of integer payload (0..255) + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_005() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + p.send(R:{ id := 1, payload := {0, 0, 0, 0} }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f710ceea3804f1396bcb78c480dd8730d0617ad7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_006.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, decoding error in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Failure of this decoding shall cause a test case error. + +module NegSem_220202_ReceiveOperation_006 { + type record R + { + integer id, + charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_006() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src) & "abcdefgij"; + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa5ed7a9537e4e2cee8c922c1768bf95f69f88d0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_007.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, invalid format value in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220202_ReceiveOperation_007 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_007() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded("proprietary") payload) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_008.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf813fbda15d80004223bb71b66ccfd47e3e4d84 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_008.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, value of wrong type in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220202_ReceiveOperation_008 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_008() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded(v_src) payload) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_009.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94bcd3e82eeb61deca487616a7f402bf47909be1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_009.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, encoding parameter of @decoded redirect assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220202_ReceiveOperation_009 { + type record R + { + integer id, + octetstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_009() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_os }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded("UTF-8") payload) { + setverdict (pass); + } + [] p.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_010.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf863a4dc4378987818b072bcd8f3e7599a28f38 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_010.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, attempting to store component name in redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When the message is received on a connected port, only the component reference is +// stored in the following the sender keyword, but the test system shall internally +// store the component name too, if any (to be used in logging). + +module NegSem_220202_ReceiveOperation_010 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_010() runs on GeneralComp system GeneralComp { + var charstring v_name; + connect(self:p, self:p); + p.send(10); + p.receive(integer:?) -> sender v_name; + if (v_name == "MTC") { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_011.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1020165edd1cbbd0f7b95ce286e26a242a061d6b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_011.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, attempting to receive a type missing from the port list + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The receive operation shall only be used on message-based ports and the type of the +// value to be received shall be included in the list of incoming types of the port type +// definition. + + +module NegSem_220202_ReceiveOperation_011 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_011() runs on GeneralComp { + var integer v_index; + p.send(10); + alt { + [] p.receive(charstring:?) { setverdict(pass); } + [] any port.receive { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_012.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83aa91f7c7f4ae690a8197a0ad8f4dd815a672d9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_012.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, value redirect assignment in receive any message statement + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// AddressRef for retrieving the sending entity shall be of type address, component or +// of the type provided in the address declaration of the port type of the port instance +// referenced in the receive operation. + +module NegSem_220202_ReceiveOperation_012 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_012() runs on GeneralComp { + var integer v_val; + p.send(10); + p.receive -> value v_val; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_013.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b31c6636aa2551944f23637a47355f4535cab7f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_013.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, trying to store address when receiving on connected port + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Type mismatch at storing the received value or parts of the received value and storing +// the sender shall cause an error. + +module NegSem_220202_ReceiveOperation_013 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_013() runs on GeneralComp system GeneralComp { + var P.address v_addr; + connect(self:p, self:p); + p.send(10); + p.receive -> sender v_addr; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_014.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cff07a8fa23fb84ccbc8079e5c27679b5ef7c1f0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_014.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, type mismatch in sender redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// AddressRef for retrieving the sending entity shall be of type address, component or +// of the type provided in the address declaration of the port type of the port instance +// referenced in the receive operation. + + +module NegSem_220202_ReceiveOperation_014 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_014() runs on GeneralComp { + var charstring v_addr; + p.send(10); + p.receive -> sender v_addr; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_015.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67be17d048aeec81b9ec231b58f46e759bc8faa4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_015.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, null component reference in from clause of receive operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_220202_ReceiveOperation_015 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_comp := null; + connect(self:p, self:p); + p.send(10); + alt { + [] p.receive from v_comp {} + [] p.receive {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_016.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f9e57d089c998aabfb6bb0bac88b01d92b94c713 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_016.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, null address reference in from clause of receive operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_220202_ReceiveOperation_016 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_016() runs on GeneralComp { + var P.address v_addr1 := 1, v_addr2 := 2, v_addr3 := null; + p.send(10); + alt { + [] p.receive from (v_addr1, v_addr2, v_addr3) {} + [] p.receive {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_017.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d728e2673b2f9bfaf811aa8129163ee1daf1c61 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_017.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, index redirection in standard port.receive + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The index redirection shall only be used when the operation is used on an any from port +// array construct. + +module NegSem_220202_ReceiveOperation_017 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_017() runs on GeneralComp { + var integer v_int; + p.send(10); + p.receive(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_018.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81165062da2de6182bb4ab86d94cb1c37897f97f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_018.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, index redirection in any port.receive + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The index redirection shall only be used when the operation is used on an any from port +// array construct. + +module NegSem_220202_ReceiveOperation_018 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_018() runs on GeneralComp { + var integer v_int; + p.send(10); + any port.receive(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_019.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..851ec4a63d65830ca881f49278ca96402256861b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_019.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, insufficient value range of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for single-dimensional port arrays, the type of the +// integer variable shall allow storing the highest index of the respective array. + +module NegSem_220202_ReceiveOperation_019 { + type integer RestrInt(0..2); + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[10]; + } + + testcase TC_NegSem_220202_ReceiveOperation_019() runs on GeneralComp { + var RestrInt v_int; + p[5].send(100); + any from p.receive(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_020.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dda8914f6d85f416865a2740d760ade73e6c82d9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_020.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, insufficient array dimension of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for multi-dimensional port arrays, the size of the +// integer array or record of integer type shall exactly be the same as the dimension of +// the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. + +module NegSem_220202_ReceiveOperation_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[3][2][3]; + } + + testcase TC_NegSem_220202_ReceiveOperation_020() runs on GeneralComp { + var integer v_indices[2]; + p[0][1][2].send(100); + any from p.receive(integer:?) -> @index value v_indices; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_021.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bb6c9013d9ce291ca324b1c04a1c4ca24c8afa9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_021.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, insufficient element value range of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for multi-dimensional port arrays, the size of the +// integer array or record of integer type shall exactly be the same as the dimension of +// the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. + +module NegSem_220202_ReceiveOperation_021 { + type integer RestrInt(0..2); + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[4][2][3]; + } + + testcase TC_NegSem_220202_ReceiveOperation_021() runs on GeneralComp { + var RestrInt v_indices[3]; + p[3][1][2].send(100); + any from p.receive(integer:?) -> @index value v_indices; + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_022.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba7113a932e454e8a367fe0d1da9b64df2667435 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_022.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, incompatible from and sender clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the receive operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_220202_ReceiveOperation_022 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_022() runs on GeneralComp { + var address v_addr; + p.send(100); + alt { + [] p.receive(integer:?) from GeneralComp:? -> sender v_addr { } + [] p.receive {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_023.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4710c6716112180c284907f7e333f0ac3ea2017f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_023.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, incompatible decmatch and @decoded value redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded message fields (by using the @decoded modifier) in +// cases where the value or template to be matched uses the MatchDecodedContent (decmatch) +// matching for the field to be stored, the type of the template in the MatchDecodedContent +// matching shall be type-compatible to the type of the variable the decoded field is stored into. + +module NegSem_220202_ReceiveOperation_023 { + + type record R { + integer id, + octetstring payload + } + + type record Wrapped { + integer num + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220202_ReceiveOperation_023() runs on GeneralComp { + var Wrapped v_res; + var R v_rec := { id := 0, payload := bit2oct(encvalue(5)) }; + p.send(v_rec); + alt { + [] p.receive(R:{ id := ?, payload := decmatch integer:? }) -> value (v_res := @decoded payload) {} + [] p.receive {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_024.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7ad9136133dde7da2b3ce7b104b59ef467533fc --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/NegSem_220202_ReceiveOperation_024.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.2.2, trying to store an incompatible component value in the sender clause of a receive operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Type mismatch at storing the received value or parts of the received value and storing +// the sender shall cause an error. + +module NegSem_220202_ReceiveOperation_024 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + type component CustomComp { + var integer vc_int; + } + + testcase TC_NegSem_220202_ReceiveOperation_024() runs on GeneralComp system GeneralComp { + var CustomComp v_sender; + connect(self:p, self:p); + p.send(10); + alt { + // this alternative shall be selected, but the assignment shall generate an error + [] p.receive(integer:?) -> sender v_sender { } + [] p.receive {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220202_ReceiveOperation_024(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..337c93c891f682cfcef1dda056885dcf1f07f1f1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_001.ttcn @@ -0,0 +1,41 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220202_ReceiveOperation_001 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220202_ReceiveOperation_001() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] messagePort.receive(1) { //must not remove message from queue + setverdict(fail); + } + [] messagePort.receive(2) { //this alt is only selected if message not removed from the queue + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220202_ReceiveOperation_001()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d29d66d31f25edb6d2980ded8ea0e66e4843695 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_002.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220202_ReceiveOperation_002 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220202_ReceiveOperation_002() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] messagePort.receive { //must remove message from queue + setverdict(pass); + } + [] messagePort.receive { //this alt is only selected if message not removed from the queue + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220202_ReceiveOperation_002()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12ebc88f718db8e13efe14d7c66c89c45c91d6b6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_003.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220202_ReceiveOperation_003 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220202_ReceiveOperation_003() runs on GeneralComp { + var integer v_received:=0; + + messagePort.send(2); + + alt { + [] messagePort.receive(integer:?) -> value v_received { + if(v_received==2) { //check that correct value has been stored + setverdict(pass); + } + else { + setverdict(fail); + } + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220202_ReceiveOperation_003()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c09d7da3c4954120ef1c948f44ef79572d1b730 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_004.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220202_ReceiveOperation_004 { + + type charstring address; + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + const address c_address := "Tester"; + + testcase TC_Sem_220202_ReceiveOperation_004() runs on GeneralComp { + var address v_sender; + + messagePort.send(2) to c_address; + + alt { + [] messagePort.receive(2) -> sender v_sender { + messagePort.send(5) to v_sender; + alt { + [] messagePort.receive(5) from v_sender { //check that correct sender address has been assigned + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + } + [] messagePort.receive { + setverdict(fail); + } + } + } + + control{ + execute(TC_Sem_220202_ReceiveOperation_004()); + } + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20c7f2e6eb59ee39d721d5cf620c6fb778247809 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.2, Ensure that the IUT correctly handles message receiving operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220202_ReceiveOperation_005 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220202_ReceiveOperation_005() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] any port.receive(2) { //checks receiving from ny port + setverdict(pass); + } + [] messagePort.receive { //this alt is only selected if message was not removed from the queue + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220202_ReceiveOperation_005()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d33be06d28379bc869fa61c3b84b296ef0a1bd07 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_006.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, receive with a from clause (single item) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the receive operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword. + +module Sem_220202_ReceiveOperation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.send(1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220202_ReceiveOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_receiveCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.receive(integer:?) from v_ptcs[0] { setverdict(pass); } // expected 1 from match + [] p.receive(integer:?) { v_receiveCounter := v_receiveCounter + 1; } // expected 2 other received messages + } + } + if (v_receiveCounter != c_ptcCount - 1) { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3ad4d5b22fe825fc3a6ea683d3df51c6dc70d61 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_007.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, receive with a from clause (multiple items) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the receive operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword. + +module Sem_220202_ReceiveOperation_007 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.send(1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220202_ReceiveOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_fromCounter := 0, v_noFromCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.receive(integer:?) from (v_ptcs[0], v_ptcs[1]) { v_fromCounter := v_fromCounter + 1; } + [] p.receive(integer:?) { v_noFromCounter := v_noFromCounter + 1; } + } + } + if (v_fromCounter == 2 and v_noFromCounter == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_008.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e96e5929b754893a1e0c3bd507246b12cfd712e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_008.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, receive with a from clause (any component) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the receive operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword. + +module Sem_220202_ReceiveOperation_008 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.send(1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220202_ReceiveOperation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.receive(integer:?) from any component { setverdict(pass); } + [] p.receive(integer:?) { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_009.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc4b5abeece6e172db1d478889dcff4524ffecb8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_009.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, redirect assignment of message fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When the keyword value is followed by an assignment list enframed by a pair of +// parentheses, the whole received message and/or one or more parts of it can be +// stored. In a single assignment within the list, on the right hand side of the +// assignment symbol (":=") a field of the template type shall be referenced, on +// the left hand side the name of the variable or a formal parameter, in which +// the value shall be stored. + +module Sem_220202_ReceiveOperation_009 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_009() runs on GeneralComp { + var integer v_int; + var charstring v_str; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.receive(R:?) -> value ( v_int := field1[1], v_str := field2) { + if (v_int == 2 and v_str == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_010.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..105bc07660230861cf31a11e8ff50e607c1d6dd2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_010.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, redirect assignment of message fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// As a special case the field reference can be absent to indicate that the whole +// message shall be stored in a variable. + +module Sem_220202_ReceiveOperation_010 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_010() runs on GeneralComp { + var integer v_int; + var charstring v_str; + var R v_rec; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.receive(R:?) -> value ( v_int := field1[1], v_rec, v_str := field2) { + if (v_int == 2 and v_str == "abc" and v_rec == { field1 := { 1, 2 }, field2 := "abc" }) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_011.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e23f25146f86ca61b27cdf7398c68e454546d62c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_011.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, @decoded redirect assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220202_ReceiveOperation_011 { + type record R + { + integer id, + bitstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_011() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var bitstring v_bs := encvalue(v_src); + p.send(R:{ id := 1, payload := v_bs }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_012.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78a64cf05bcd1894cbe4fe53f436d4bcb0b9991d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_012.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, @decoded redirect assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220202_ReceiveOperation_012 { + type record R + { + integer id, + hexstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_012() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var hexstring v_hs := bit2hex(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_hs }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_013.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..917d4c65c71f4000a44fb8b5d07930a22df1cb4a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_013.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, @decoded redirect assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220202_ReceiveOperation_013 { + type record R + { + integer id, + octetstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_013() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_os }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_014.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5247b68b1f6479a5f7b5fab7e4c6e97a0893480 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_014.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, @decoded redirect assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220202_ReceiveOperation_014 { + type record R + { + integer id, + charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_014() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_015.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2a549f269d84d7c5c208e692dc8e56eaf89f796 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_015.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, @decoded redirect assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220202_ReceiveOperation_015 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_015() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_016.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0c9a5e8f7573e62f1607a069a78c1a4690b897c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_016.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.2, @decoded redirect assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220202_ReceiveOperation_016 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_016() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { variant "32 bit" }; + var universal charstring v_str := encvalue_unichar(v_src, "UTF-16LE"); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.receive(R:?) -> value (v_res := @decoded("UTF-16LE") payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_017.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7480fb6b37c7d67a48d59b0bb8a1740ccbb825eb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_017.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, redirect assignment storing a component + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to retrieve and store the component reference or address of +// the sender of a message. This is denoted by the keyword sender. + +module Sem_220202_ReceiveOperation_017 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_tc := null; + connect(self:p, self:p); + p.send(10); + p.receive(integer:?) -> sender v_tc; + if (v_tc == self) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_018.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d868755a12972e33b09347dae84827ced49dd8fb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_018.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, redirect assignment storing an address + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to retrieve and store the component reference or address of +// the sender of a message. This is denoted by the keyword sender. + +module Sem_220202_ReceiveOperation_018 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_018() runs on GeneralComp { + var P.address v_addr := null; + p.send(10) to 5; + p.receive(integer:?) -> sender v_addr; + if (v_addr == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_019.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6a7dc3ab83f287f37cdf221d600bfa0dd306ee0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_019.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, any from port.receive statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// To receive a message on any port from a specific port array, use the any from +// PortArrayRef syntax where PortArrayRef shall be a reference to a port array +// identifier. + +module Sem_220202_ReceiveOperation_019 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [3]; + } + + testcase TC_Sem_220202_ReceiveOperation_019() runs on GeneralComp { + p[2].send(10); + alt { + [] any from p.receive(integer:?) { setverdict(pass); } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_020.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d98bc80e9af2d7b7edd98ced3da965c3017b5f9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_020.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, single dimensional index redirect in any from port.receive statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array +// at which the operation was successful to a variable of type integer or, in case of +// multi-dimensional port arrays the index of the successful port to an integer array +// or record of integer variable. When checking the port array for matching messages, +// the port indices to be checked are iterated from lowest to highest. If the port +// array is multi-dimensional, then the ports are iterated over from innermost to +// outermost array dimension from lowest to highest index for each dimension, e.g. +// [0][0], [0][1], [1][0], [1][1]. The first port which matches all the criteria will +// cause the operation to be successful even if other ports in the array would also +// meet the criteria. + +module Sem_220202_ReceiveOperation_020 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [3]; + } + + testcase TC_Sem_220202_ReceiveOperation_020() runs on GeneralComp { + var integer v_index; + p[2].send(10); + alt { + [] any from p.receive(integer:?) -> @index value v_index { + if (v_index == 2) { setverdict(pass); } + else { setverdict(fail); } + } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_021.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8df547bc99c54df461c54443a1888d523ac25fa --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_021.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, multidimensional index redirect in any from port.receive statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array +// at which the operation was successful to a variable of type integer or, in case of +// multi-dimensional port arrays the index of the successful port to an integer array +// or record of integer variable. When checking the port array for matching messages, +// the port indices to be checked are iterated from lowest to highest. If the port +// array is multi-dimensional, then the ports are iterated over from innermost to +// outermost array dimension from lowest to highest index for each dimension, e.g. +// [0][0], [0][1], [1][0], [1][1]. The first port which matches all the criteria will +// cause the operation to be successful even if other ports in the array would also +// meet the criteria. + +module Sem_220202_ReceiveOperation_021 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [2][3]; + } + + type record of integer RoI; + + testcase TC_Sem_220202_ReceiveOperation_021() runs on GeneralComp { + var RoI v_index; + p[0][2].send(10); + alt { + [] any from p.receive(integer:?) -> @index value v_index { + if (v_index == { 0, 2 }) { setverdict(pass); } + else { setverdict(fail, "v_index: ", v_index); } + } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_022.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52fa8958b64d06965ff831d050b3d1834c53a7e6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_022.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, standalone receive as a shorthand for alt statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The receive operation can be used as a stand-alone statement in a behaviour description. +// In this latter case the receive operation is considered to be shorthand for an alt +// statement with the receive operation as the only alternative. + +module Sem_220202_ReceiveOperation_022 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive(10) { setverdict(pass); } + } + + testcase TC_Sem_220202_ReceiveOperation_022() runs on GeneralComp { + activate(a()); // defaults should be processed as a part of alt + p.send(10); + p.receive(0); // no match here, but because the statement is actually an alt statement, + // the default shall be automatically exectuted and accept the message + } + + control { + execute(TC_Sem_220202_ReceiveOperation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_023.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03436c379759047b6606865eed08e292fb6b8725 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_023.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, single dimensional index redirect in any from port.receive statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// No binding of the incoming values to the terms of the expression or to the template +// shall occur. + +module Sem_220202_ReceiveOperation_023 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_023() runs on GeneralComp { + var template integer v_expectedValue := ?; + p.send(10); + p.receive(v_expectedValue); + // make sure the template variable hasn't changed: + if (istemplatekind(v_expectedValue, "AnyValue")) {setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_024.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2ea2bc4bdcbd437151a4b0db0e4ef6c17a13f795 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_024.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, lazy variable in value redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_024 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_024() runs on GeneralComp { + var @lazy integer v_int; + p.send(1); + p.send(2); + p.send(3); + p.receive(integer:?) -> value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_024(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_025.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c7d696f9c14b479842bb41f27547b3c5482a670 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_025.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, lazy variable in sender redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_025 { + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_025() runs on GeneralComp { + var @lazy address v_addr; + p.send(1) to 1; + p.send(2) to 2; + p.send(3) to 3; + p.receive(integer:?) -> sender v_addr; + if (v_addr == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_025(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_026.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7126d47225fab6448ef5b6978ce923b6fcf9219b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_026.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, lazy variable in index redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_026 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[2]; + } + + testcase TC_Sem_220202_ReceiveOperation_026() runs on GeneralComp { + var @lazy integer v_int; + p[1].send(1); + p[1].send(2); + p[1].send(3); + any from p.receive(integer:?) -> @index value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p[1].receive(integer:2) { setverdict(pass); } + [] any from p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_026(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_027.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55ef055923097c950f4340960ebd1bcea28c3d50 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_027.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, fuzzy variable in value redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_027 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_027() runs on GeneralComp { + var @fuzzy integer v_int; + p.send(1); + p.send(2); + p.send(3); + p.receive(integer:?) -> value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_027(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_028.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a66b16f084f6318e31481e9b72deb32979d9402b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_028.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, fuzzy variable in sender redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_028 { + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_028() runs on GeneralComp { + var @fuzzy address v_addr; + p.send(1) to 1; + p.send(2) to 2; + p.send(3) to 3; + p.receive(integer:?) -> sender v_addr; + if (v_addr == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_028(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_029.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5ef6768aa9f8ac0d86594c2b8bde95e1f24508d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_029.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.2, fuzzy variable in @index redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the receive operation. + +module Sem_220202_ReceiveOperation_029 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[2]; + } + + testcase TC_Sem_220202_ReceiveOperation_029() runs on GeneralComp { + var @fuzzy integer v_int; + p[1].send(1); + p[1].send(2); + p[1].send(3); + any from p.receive(integer:?) -> @index value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p[1].receive(integer:2) { setverdict(pass); } + [] any from p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_029(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_030.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..116399c657537fe3e66f421b781fd7df2287cf56 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220202_receive_operation/Sem_220202_ReceiveOperation_030.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.2.2, verify that a variable of a different but compatible type can be used in a redirect assignment + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The assignment part in a receiving operation is optional. For message-based ports it is used when it is +// required to store received messages. In the case of procedure-based ports it is used for storing the in +// and inout parameters of an accepted call, for storing the return value or for storing exceptions. +// For the message or parameter value assignment part strong typing is not required, e.g. the variable used +// for storing a message shall be type-compatible to the type of the incoming message. + +module Sem_220202_ReceiveOperation_030 { + + type port P message { + inout integer; + } + + type integer UInt8 (0..255); + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220202_ReceiveOperation_030() runs on GeneralComp { + var UInt8 v_int; + p.send(10); + p.receive(integer:?) -> value v_int; + if (v_int == 10) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220202_ReceiveOperation_030(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..236019fdffc4da29c9a6f7c481e71792c8b515f0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_001.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220203_TriggerOperation_001 { + +signature p_NegSem_220203_TriggerOperation_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + +template p_NegSem_220203_TriggerOperation_001 s_baseTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := ? +} + +template p_NegSem_220203_TriggerOperation_001 s_returnTemplate modifies s_baseTemplate := { + p_par3 := 5 +} + +template p_NegSem_220203_TriggerOperation_001 s_wrongTemplate modifies s_baseTemplate := { + p_par3 := 3 +} + +template p_NegSem_220203_TriggerOperation_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 +} + + type port remotePort procedure { + out p_NegSem_220203_TriggerOperation_001; + } + +type component GeneralComp { + port remotePort PCO; +} + +testcase NegSem_220203_TriggerOperation_001() runs on GeneralComp { + + PCO.call(p_NegSem_220203_TriggerOperation_001:s_callTemplate, 5.0) { + + [] PCO.trigger(p_NegSem_220203_TriggerOperation_001:s_wrongTemplate value 1) { //cannot trigger from procedure based port + setverdict(fail); + } + [] PCO.trigger(p_NegSem_220203_TriggerOperation_001:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.trigger(p_NegSem_220203_TriggerOperation_001:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } +} + +control{ + execute(NegSem_220203_TriggerOperation_001()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9eadcf85afff57c8adb1fb6ce45a69c1b1b09114 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_002.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, no type prefix in ambiguous inline template + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The matching criteria as defined in clause 22.2.2 apply also to the trigger operation. +// An optional type field in the matching criteria to the [trigger] operation shall +// be used to avoid any ambiguity of the type of the value being received. + +module NegSem_220203_TriggerOperation_002 { + + type record of integer RoI; + type record R { + integer field1, + integer field2 + } + + type port P message { + inout R, RoI; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_002() runs on GeneralComp { + p.send(R:{1, 2}); + alt { + [] p.trigger({?, 2}) { setverdict(pass); } // error (ambiguous type) + [else] { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37890e6d21b9f1b7578e195b70667b09c242cbce --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_003.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, type mismatch in redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// The variable or formal parameter shall be type compatible with the received message. + +module NegSem_220203_TriggerOperation_003 { + + type port P message { + inout integer, charstring; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_003() runs on GeneralComp { + var charstring v_str; + p.send(1); + alt { + [] p.trigger(integer:?) -> value v_str { setverdict(pass); } // error (type mismatch in redirect assignment) + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05d515b808cb3e8bb4628224daa30ff682f87de4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_004.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, type mismatch in redirect assignment of message fields + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// The variable or formal parameter shall be type compatible with the type on the +// right hand side of the assignment symbol. + +module NegSem_220203_TriggerOperation_004 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_004() runs on GeneralComp { + var integer v_int; + var bitstring v_str; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.trigger(R:?) -> value ( v_int := field1[1], v_str := field2) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..668a50a115c8520b1d5c7f5a7b1b75579d3b0a78 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, applying @decoded to a forbidden field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220203_TriggerOperation_005 { + type record R + { + integer id, + record of integer payload (0..255) + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_005() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + p.send(R:{ id := 1, payload := {0, 0, 0, 0} }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c43b78ca6207e946bf4580bfa4ee4430911169d7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_006.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, decoding error in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// Failure of this decoding shall cause a test case error. + +module NegSem_220203_TriggerOperation_006 { + type record R + { + integer id, + charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_006() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src) & "abcdefgij"; + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2295f59b44cb580b4746df1b8acb2c879030b3f0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_007.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, invalid format value in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// Any other value shall cause an error. + +module NegSem_220203_TriggerOperation_007 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_007() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded("proprietary") payload) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_008.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37aeacb2d2ff361c1841cc8a6a95bd7aee6d62f4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_008.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, value of wrong type in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// Any other value shall cause an error. + +module NegSem_220203_TriggerOperation_008 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_008() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded(v_src) payload) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_009.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..687b3bb79c2b71e0c9801d2417a575b2e4bbe3f7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_009.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, encoding parameter of @decoded redirect assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220203_TriggerOperation_009 { + type record R + { + integer id, + octetstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_009() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_os }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded("UTF-8") payload) { + setverdict (pass); + } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_010.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3b00cbb3ad142eb443a7326ead4dd7b9e556628 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_010.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, attempting to store component name in redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When the message is received on a connected port, only the component reference is +// stored in the following the sender keyword, but the test system shall internally +// store the component name too, if any (to be used in logging). + +module NegSem_220203_TriggerOperation_010 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_010() runs on GeneralComp system GeneralComp { + var charstring v_name; + connect(self:p, self:p); + p.send(10); + p.trigger(integer:?) -> sender v_name; + if (v_name == "MTC") { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_011.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2d586c269d9c304749040c2db1d6e85a9be5d8e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_011.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, attempting to receive a type missing from the port list + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The trigger operation shall only be used on message-based ports and the type of the +// value to be received shall be included in the list of incoming types of the port type +// definition. + + +module NegSem_220203_TriggerOperation_011 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_011() runs on GeneralComp { + var integer v_index; + p.send(10); + alt { + [] p.trigger(charstring:?) { setverdict(pass); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220203_TriggerOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_012.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ed8363e72a6e1ba11381b738deba0344764c6b1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_012.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, value redirect assignment in receive any message statement + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// AddressRef for retrieving the sending entity shall be of type address, component or +// of the type provided in the address declaration of the port type of the port instance +// referenced in the receive operation. + +module NegSem_220203_TriggerOperation_012 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_012() runs on GeneralComp { + var integer v_val; + p.send(10); + p.trigger -> value v_val; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_013.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..796fdf629483f41165daee9405e51fd758ee921c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_013.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, trying to store address with trigger operation on connected port + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Type mismatch at storing the received value or parts of the received value and storing +// the sender shall cause an error. + +module NegSem_220203_TriggerOperation_013 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_013() runs on GeneralComp system GeneralComp { + var P.address v_addr; + connect(self:p, self:p); + p.send(10); + p.trigger -> sender v_addr; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_014.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6eae9e54ca9a12c8831b0ab7945499694725c743 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_014.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, type mismatch in sender redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// AddressRef for retrieving the sending entity shall be of type address, component or +// of the type provided in the address declaration of the port type of the port instance +// referenced in the receive operation. + + +module NegSem_220203_TriggerOperation_014 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_014() runs on GeneralComp { + var charstring v_addr; + p.send(10); + p.trigger -> sender v_addr; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_015.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..047b54043b645df7339db0664f63f721720726f0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_015.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, null component reference in from clause of trigger operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_220203_TriggerOperation_015 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_comp := null; + connect(self:p, self:p); + p.send(10); + alt { + [] p.trigger from v_comp {} + [else] {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_016.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8728563daa23a2d5d3b9d48f89c1b84be563576 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_016.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, null address reference in from clause of receive operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_220203_TriggerOperation_016 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_016() runs on GeneralComp { + var P.address v_addr1 := 1, v_addr2 := 2, v_addr3 := null; + p.send(10); + alt { + [] p.trigger from (v_addr1, v_addr2, v_addr3) {} + [else] {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_017.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22609648f14c84c2bb41682d910b8e21c199c5f1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_017.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, index redirection in standard port.trigger + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The index redirection shall only be used when the operation is used on an any from port +// array construct. + +module NegSem_220203_TriggerOperation_017 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_017() runs on GeneralComp { + var integer v_int; + p.send(10); + p.trigger(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_018.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f30a5b77930276fcb7d826cce9127f0c0b653ca --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_018.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, index redirection in any port.receive + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// The index redirection shall only be used when the operation is used on an any from port +// array construct. + +module NegSem_220203_TriggerOperation_018 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_018() runs on GeneralComp { + var integer v_int; + p.send(10); + any port.trigger(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_019.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..846f7f8d840387843da7a81cfe0a2fdaaf2cb2f1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_019.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, insufficient value range of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for single-dimensional port arrays, the type of the +// integer variable shall allow storing the highest index of the respective array. + +module NegSem_220203_TriggerOperation_019 { + type integer RestrInt(0..2); + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[10]; + } + + testcase TC_NegSem_220203_TriggerOperation_019() runs on GeneralComp { + var RestrInt v_int; + p[5].send(100); + any from p.trigger(integer:?) -> @index value v_int; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_020.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e14d3f859135bf84cdd51109f89ab22fc7334215 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_020.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, insufficient array dimension of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for multi-dimensional port arrays, the size of the +// integer array or record of integer type shall exactly be the same as the dimension of +// the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. + +module NegSem_220203_TriggerOperation_020 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[3][2][3]; + } + + testcase TC_NegSem_220203_TriggerOperation_020() runs on GeneralComp { + var integer v_indices[2]; + p[0][1][2].send(100); + any from p.trigger(integer:?) -> @index value v_indices; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_021.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36d1f356b9f4370d873fd11f1c44d8bcb4ee1f7b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_021.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, insufficient element value range of variable in index redirection + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the index redirection is used for multi-dimensional port arrays, the size of the +// integer array or record of integer type shall exactly be the same as the dimension of +// the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. + +module NegSem_220203_TriggerOperation_021 { + type integer RestrInt(0..2); + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[4][2][3]; + } + + testcase TC_NegSem_220203_TriggerOperation_021() runs on GeneralComp { + var RestrInt v_indices[3]; + p[3][1][2].send(100); + any from p.trigger(integer:?) -> @index value v_indices; + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_022.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02159791cd282e55e841c700539984c3fb59f3f6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_022.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, incompatible from and sender clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the trigger operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_220203_TriggerOperation_022 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_022() runs on GeneralComp { + var address v_addr; + p.send(100); + alt { + [] p.trigger(integer:?) from GeneralComp:? -> sender v_addr { } + [else] {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_023.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..565b74c4f3ce5210014f01d6cf214326c569c326 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_023.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.3, incompatible decmatch and @decoded value redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded message fields (by using the @decoded modifier) in +// cases where the value or template to be matched uses the MatchDecodedContent (decmatch) +// matching for the field to be stored, the type of the template in the MatchDecodedContent +// matching shall be type-compatible to the type of the variable the decoded field is stored into. + +module NegSem_220203_TriggerOperation_023 { + + type record R { + integer id, + octetstring payload + } + + type record Wrapped { + integer num + } + + type port P message { + inout R; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220203_TriggerOperation_023() runs on GeneralComp { + var Wrapped v_res; + var R v_rec := { id := 0, payload := bit2oct(encvalue(5)) }; + timer t_tmr := 1.0; + t_tmr.start; + p.send(v_rec); + alt { + [] p.trigger(R:{ id := ?, payload := decmatch integer:? }) -> value (v_res := @decoded payload) {} + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_024.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..adfd02ffcc78a69e749d7a5627a398c30a07883b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/NegSem_220203_TriggerOperation_024.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.2.3, trying to store an incompatible component value in the sender clause of a trigger operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Type mismatch at storing the received value or parts of the received value and storing +// the sender shall cause an error. + +module NegSem_220203_TriggerOperation_024 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + type component CustomComp { + var integer vc_int; + } + + testcase TC_NegSem_220203_TriggerOperation_024() runs on GeneralComp system GeneralComp { + var CustomComp v_sender; + timer t_tmr := 0.1; + t_tmr.start; + connect(self:p, self:p); + p.send(10); + alt { + // this alternative shall be selected, but the assignment shall generate an error + [] p.trigger(integer:?) -> sender v_sender { } + [] t_tmr.timeout {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220203_TriggerOperation_024(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_001.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a21daf22bcf9f20afe02b453c9cb606dbc533b45 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_001.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220203_TriggerOperation_001 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220203_TriggerOperation_001() runs on GeneralComp { + + timer t_timeout := 1.0; + t_timeout.start; + + messagePort.send(2); + + alt { + [] messagePort.trigger(1) { //must remove message from queue + setverdict(fail); + } + [] messagePort.trigger(2) { //this alt is only selected if message not removed from the queue + setverdict(fail); + } + [] messagePort.trigger { + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_220203_TriggerOperation_001()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_002.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc2ead28594c5f3f4fa0af34d01c2153b52f8376 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_002.ttcn @@ -0,0 +1,43 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220203_TriggerOperation_002 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220203_TriggerOperation_002() runs on GeneralComp { + timer t_timeout:=5.0; + + messagePort.send(2); + t_timeout.start; + + alt { + [] messagePort.trigger { //must remove message from queue + setverdict(pass); + } + [] messagePort.trigger { //this alt is only selected if message not removed from the queue + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_220203_TriggerOperation_002()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_003.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..819b0501b74bf326a6867a6436a8e9601c5fb77b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_003.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220203_TriggerOperation_003 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220203_TriggerOperation_003() runs on GeneralComp { + var integer v_received:=0; + timer t_timeout:=5.0; + + messagePort.send(2); + t_timeout.start; + + alt { + [] messagePort.trigger(integer:?) -> value v_received { + if(v_received==2) { //check that correct value has been stored + setverdict(pass); + } + else { + setverdict(fail); + } + } + [] messagePort.receive { + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_220203_TriggerOperation_003()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_004.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55bae82c5b3a19cd930a07775ea1f20271818e1c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_004.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220203_TriggerOperation_004 { + + type charstring address; + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + const address c_address := "Tester"; + +testcase TC_Sem_220203_TriggerOperation_004() runs on GeneralComp { + var address v_sender; + timer t_timeout:=5.0; + + + messagePort.send(2) to c_address; + t_timeout.start; + + alt { + [] messagePort.trigger(2) -> sender v_sender { + messagePort.send(5) to v_sender; + alt { + [] messagePort.trigger(5) from v_sender { //check that correct sender address has been assigned + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + } + } + [] messagePort.trigger { + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220203_TriggerOperation_004()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_005.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d4fc52c7138e51004822739591bcda3d46584d4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_005.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.2.3, Ensure that the IUT correctly handles message trigger operations + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_220203_TriggerOperation_005 { + + + type port loopbackPort message { + inout integer + } + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_220203_TriggerOperation_005() runs on GeneralComp { + timer t_timeout:=5.0; + + messagePort.send(2); + t_timeout.start; + + alt { + [] any port.trigger(2) { //checks trigger from any port + setverdict(pass); + } + [] messagePort.trigger { //this alt is only selected if message was not removed from the queue + setverdict(fail); + } + [] t_timeout.timeout { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_220203_TriggerOperation_005()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_006.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2c4101c4c0e95b5f043196e44470121d81572de --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_006.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.3, trigger with a from clause (single item) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the trigger operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword followed by a specification of an address or component reference, +// a list of address or component references or any component. + +module Sem_220203_TriggerOperation_006 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer i) runs on GeneralComp + { + p.send(i); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220203_TriggerOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_int; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(i)); + } + + alt { + [] p.trigger(integer:?) from v_ptcs[c_ptcCount - 1] -> value v_int { + if (v_int == c_ptcCount - 1) { setverdict(pass); } + else { setverdict(fail) }; + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_007.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..252bd99955b069e6ce448b28c9b767a72ce1df6e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_007.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.3, trigger with a from clause (multiple items) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the trigger operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword followed by a specification of an address or component reference, +// a list of address or component references or any component. + +module Sem_220203_TriggerOperation_007 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f(integer i) runs on GeneralComp + { + p.send(i); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220203_TriggerOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_int; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f(i)); + } + + alt { + [] p.trigger(integer:?) from (v_ptcs[c_ptcCount - 2], v_ptcs[c_ptcCount - 1]) -> value v_int { + if (v_int == c_ptcCount - 2 or v_int == c_ptcCount - 1) { setverdict(pass); } + else { setverdict(fail) }; + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_008.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fa85a86ce5bf80ece6be07f98f664d2fbf1080c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_008.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.3, trigger with a from clause (any component) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In the case of one-to-many connections the trigger operation may be restricted +// to a certain communication partner. This restriction shall be denoted using the +// from keyword followed by a specification of an address or component reference, +// a list of address or component references or any component. + +module Sem_220203_TriggerOperation_008 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.send(1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220203_TriggerOperation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.trigger(integer:?) from any component { setverdict(pass); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_009.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e1a94dd269c0981498db579ff4c9ca7d09b704b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_009.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, redirect assignment of message fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When the keyword value is followed by an assignment list enframed by a pair of +// parentheses, the whole received message and/or one or more parts of it can be +// stored. In a single assignment within the list, on the right hand side of the +// assignment symbol (":=") a field of the template type shall be referenced, on +// the left hand side the name of the variable or a formal parameter, in which +// the value shall be stored. + +module Sem_220203_TriggerOperation_009 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_009() runs on GeneralComp { + var integer v_int; + var charstring v_str; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.trigger(R:?) -> value ( v_int := field1[1], v_str := field2) { + if (v_int == 2 and v_str == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_010.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..edb349b2676bf45ab2cf9407952fb21e106371ea --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_010.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, redirect assignment of message fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// As a special case the field reference can be absent to indicate that the whole +// message shall be stored in a variable. + +module Sem_220203_TriggerOperation_010 { + type record R + { + integer field1[2], + charstring field2 + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_010() runs on GeneralComp { + var integer v_int; + var charstring v_str; + var R v_rec; + p.send(R:{ field1 := { 1, 2 }, field2 := "abc" }); + alt { + [] p.trigger(R:?) -> value ( v_int := field1[1], v_rec, v_str := field2) { + if (v_int == 2 and v_str == "abc" and v_rec == { field1 := { 1, 2 }, field2 := "abc" }) { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_011.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8197fac07cffbd78979ea9ced56709b34f59e917 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_011.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, @decoded redirect assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220203_TriggerOperation_011 { + type record R + { + integer id, + bitstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_011() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var bitstring v_bs := encvalue(v_src); + p.send(R:{ id := 1, payload := v_bs }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_012.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60b0c84d795a193566d496b610f49839f08873c9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_012.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, @decoded redirect assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220203_TriggerOperation_012 { + type record R + { + integer id, + hexstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_012() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var hexstring v_hs := bit2hex(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_hs }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_013.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..874605af9056333496a61e5199a910a943d9a380 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_013.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, @decoded redirect assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220203_TriggerOperation_013 { + type record R + { + integer id, + octetstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_013() runs on GeneralComp { + var charstring v_src := "abc", v_res; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.send(R:{ id := 1, payload := v_os }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_014.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f55d568d91243ddf11157334913fb0b5406a34b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_014.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, @decoded redirect assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220203_TriggerOperation_014 { + type record R + { + integer id, + charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_014() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_015.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd81033d200d00981754bb18b6e4bdc14e0053ec --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_015.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, @decoded redirect assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220203_TriggerOperation_015 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_015() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_016.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ed8e862c0b19753c9afc78699f7ef2d79c2f938 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_016.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.2.3, @decoded redirect assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220203_TriggerOperation_016 { + type record R + { + integer id, + universal charstring payload + } + + type port P message { + inout R; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_016() runs on GeneralComp { + var integer v_src := 1953719668, v_res with { variant "32 bit" }; + var universal charstring v_str := encvalue_unichar(v_src, "UTF-16LE"); + p.send(R:{ id := 1, payload := v_str }); + alt { + [] p.trigger(R:?) -> value (v_res := @decoded("UTF-16LE") payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_017.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2cf5d03ff5a43edc8fe1fc2e10df7aca40b1ca34 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_017.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, redirect assignment storing a component + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Rules in clause 22.2.2 shall apply. +// It is also possible to retrieve and store the component reference or address of +// the sender of a message. This is denoted by the keyword sender. + +module Sem_220203_TriggerOperation_017 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_tc := null; + connect(self:p, self:p); + p.send(10); + p.trigger(integer:?) -> sender v_tc; + if (v_tc == self) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220203_TriggerOperation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_018.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a529e1a7970548df6cad00c4772acf46d9b6da07 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_018.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, redirect assignment storing an address + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to retrieve and store the component reference or address of +// the sender of a message. This is denoted by the keyword sender. + +module Sem_220203_TriggerOperation_018 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_018() runs on GeneralComp { + var P.address v_addr := null; + p.send(10) to 5; + p.trigger(integer:?) -> sender v_addr; + if (v_addr == 5) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220203_TriggerOperation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_019.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d144736ce9dcba833e89ec9b9382e838595b279 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_019.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, any from port.trigger statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// To trigger on a message at any port from a specific port array, use the any from +// PortArrayRef syntax where PortArrayRef shall be a reference to a port array +// identifier. + +module Sem_220203_TriggerOperation_019 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [3]; + port P altP; + } + + testcase TC_Sem_220203_TriggerOperation_019() runs on GeneralComp { + p[2].send(10); + altP.send(1); + alt { + [] any from p.trigger(integer:?) { setverdict(pass); } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_020.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6babff43e67961f4d99d97d095faac8f946e6552 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_020.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, single dimensional index redirect in any from port.trigger statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array +// at which the operation was successful to a variable of type integer or, in case of +// multi-dimensional port arrays the index of the successful port to an integer array +// or record of integer variable. When checking the port array for matching messages, +// the port indices to be checked are iterated from lowest to highest. If the port +// array is multi-dimensional, then the ports are iterated over from innermost to +// outermost array dimension from lowest to highest index for each dimension, e.g. +// [0][0], [0][1], [1][0], [1][1]. The first port which matches all the criteria will +// cause the operation to be successful even if other ports in the array would also +// meet the criteria. + +module Sem_220203_TriggerOperation_020 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [3]; + port P altP; + } + + testcase TC_Sem_220203_TriggerOperation_020() runs on GeneralComp { + var integer v_index; + p[2].send(10); + altP.send(1); + alt { + [] any from p.trigger(integer:?) -> @index value v_index { + if (v_index == 2) { setverdict(pass); } + else { setverdict(fail); } + } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_021.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e68891f7271f5b0bb63348a4b1147bb8b4796b27 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_021.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, multidimensional index redirect in any from port.trigger statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array +// at which the operation was successful to a variable of type integer or, in case of +// multi-dimensional port arrays the index of the successful port to an integer array +// or record of integer variable. When checking the port array for matching messages, +// the port indices to be checked are iterated from lowest to highest. If the port +// array is multi-dimensional, then the ports are iterated over from innermost to +// outermost array dimension from lowest to highest index for each dimension, e.g. +// [0][0], [0][1], [1][0], [1][1]. The first port which matches all the criteria will +// cause the operation to be successful even if other ports in the array would also +// meet the criteria. + +module Sem_220203_TriggerOperation_021 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p [2][3]; + port P altP; + } + + type record of integer RoI; + + testcase TC_Sem_220203_TriggerOperation_021() runs on GeneralComp { + var RoI v_index; + p[0][2].send(10); + altP.send(1); + alt { + [] any from p.trigger(integer:?) -> @index value v_index { + if (v_index == { 0, 2 }) { setverdict(pass); } + else { setverdict(fail, "v_index: ", v_index); } + } + [] any port.receive { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_022.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d5e9ba4b519b2dd601b7ef2f2eebcbaf01ccb9cb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_022.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, standalone trigger as a shorthand for alt statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The trigger operation can be used as a stand-alone statement in a behaviour description. +// In this latter case the receive operation is considered to be shorthand for an alt +// statement with two alternatives (one alternative expecting the message and another +// alternative consuming all other messages and repeating the alt statement, see +// ES 201 873 4 [1]). + +module Sem_220203_TriggerOperation_022 { + + type port P message { + inout integer; + } + + type component GeneralComp + { + port P p1, p2; + } + + altstep a() runs on GeneralComp { + [] p2.receive(integer:?) { setverdict(pass); } + } + + testcase TC_Sem_220203_TriggerOperation_022() runs on GeneralComp { + activate(a()); // defaults should be processed as a part of alt + p1.send(1); + p2.send(2); + p1.trigger(integer:(10..20)); // no match here, but because the statement is actually an alt statement, + // the default shall be automatically exectuted and accept the message + } + + control { + execute(TC_Sem_220203_TriggerOperation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_023.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..be12e422553bd197c97b6a0ba4909831609358ae --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_023.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, lazy variable in value redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_023 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_023() runs on GeneralComp { + var @lazy integer v_int; + p.send(1); + p.send(2); + p.send(3); + p.trigger(integer:?) -> value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_024.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c14e59bbf7c3b0e971ba205a5a33bc11c6d0982 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_024.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, lazy variable in sender redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_024 { + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_024() runs on GeneralComp { + var @lazy address v_addr; + p.send(1) to 1; + p.send(2) to 2; + p.send(3) to 3; + p.trigger(integer:?) -> sender v_addr; + if (v_addr == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_024(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_025.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9401a2bb3718ce39d7297b1ef5388486ee2c9e8e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_025.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, lazy variable in index redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_025 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[2]; + } + + testcase TC_Sem_220203_TriggerOperation_025() runs on GeneralComp { + var @lazy integer v_int; + p[1].send(1); + p[1].send(2); + p[1].send(3); + any from p.trigger(integer:?) -> @index value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p[1].receive(integer:2) { setverdict(pass); } + [] any from p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_025(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_026.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..995a5a0790ae10bef58b67c544fdc02ebe569edb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_026.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, fuzzy variable in value redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_026 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_026() runs on GeneralComp { + var @fuzzy integer v_int; + p.send(1); + p.send(2); + p.send(3); + p.trigger(integer:?) -> value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_026(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_027.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2f4a9a14d0ed725f4e5134918a46c4146ccd5cc --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_027.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, fuzzy variable in sender redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_027 { + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_220203_TriggerOperation_027() runs on GeneralComp { + var @fuzzy address v_addr; + p.send(1) to 1; + p.send(2) to 2; + p.send(3) to 3; + p.trigger(integer:?) -> sender v_addr; + if (v_addr == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p.receive(integer:2) { setverdict(pass); } + [] p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_027(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_028.ttcn b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c94d09a4c0e59ac117646d952272d63378ed348 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2202_message_based_communication/220203_trigger_operation/Sem_220203_TriggerOperation_028.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.2.3, fuzzy variable in @index redirect + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// If a variable referenced in the value, sender or @index clause is a lazy or fuzzy +// variable, the expression assigned to this variable is equal to the result produced +// by the trigger operation i.e. later evaluation of the lazy or fuzzy variable does not +// lead to repeated invocation of the trigger operation. + +module Sem_220203_TriggerOperation_028 { + type port P message { + inout integer; + } + + type component GeneralComp { + port P p[2]; + } + + testcase TC_Sem_220203_TriggerOperation_028() runs on GeneralComp { + var @fuzzy integer v_int; + p[1].send(1); + p[1].send(2); + p[1].send(3); + any from p.trigger(integer:?) -> @index value v_int; + if (v_int == 1) { // evaluation of @lazy (receive shall not be called again) + alt { + [] p[1].receive(integer:2) { setverdict(pass); } + [] any from p.receive { setverdict(fail); } + } + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_220203_TriggerOperation_028(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddb371d487c9b320fe05985443920ca9e9f953e1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles procedure call operations + ** @verdict pass reject + ***************************************************/ + +module NegSem_220301_CallOperation_001 { + + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + testcase TC_NegSem_220301_CallOperation_001() runs on GeneralComp { + + messagePort.call(2); //cannot use call on a message based port + + alt { + [] messagePort.receive { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + } + + control{ + execute(TC_NegSem_220301_CallOperation_001()); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f335e979d8f47f5dfaaf6c10d96d76f4f823825 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_002.ttcn @@ -0,0 +1,121 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly procedure calls + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220301_CallOperation_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_NegSem_220301_CallOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_NegSem_220301_CallOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_NegSem_220301_CallOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_NegSem_220301_CallOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_NegSem_220301_CallOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + //nowait cannot be used in this construct with timeout checking + PCO.call(p_NegSem_220301_CallOperation_002:s_callTemplate, nowait) { + + [] PCO.getreply(p_NegSem_220301_CallOperation_002:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220301_CallOperation_002:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220301_CallOperation_002:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_NegSem_220301_CallOperation_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_NegSem_220301_CallOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_NegSem_220301_CallOperation_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_NegSem_220301_CallOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_220301_CallOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec030aca5403637b8c08c278e8e6b8a8b08c6d7c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.1, null component in the to clause of the call operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220301_CallOperation_003 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + + testcase TC_NegSem_220301_CallOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"), v_compRef := null; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait) to v_compRef; + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_003(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79985f839fa856d40ab899731ae298acdaa61d04 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_004.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.1, null component in the multicast list of the to clause of the call operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220301_CallOperation_004 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + + testcase TC_NegSem_220301_CallOperation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"), v_compRef := null; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait) to (v_ptc, v_compRef); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_004(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e25f98fdfc47c1d0dd8803cc6e15dfc933a548c1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_005.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, incompatible template in the to clause of the call operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// f) All AddressRef items in the to clause and all VariableRef items in the sender clause +// shall be of type address, component or of the address type bound to the port type (see +// section 6.2.9) of the port instance referenced in the call operation. + +module NegSem_220301_CallOperation_005 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220301_CallOperation_005() runs on GeneralComp system GeneralComp { + var charstring v_addr := "addr"; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait) to v_addr; + setverdict(pass); + } + + control { + execute(TC_NegSem_220301_CallOperation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2df7e03a9f5f18e2da794bcd24cdd6b8ba5fa03f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_006.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that non-blocking calls cannot have a response and exception handling part + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case of non-blocking procedure-based communication the handling of exceptions +// to call operations is done by using catch (see clause 22.3.6) operations as +// alternatives in alt statements. +// A non-blocking procedure has no out and inout parameters, no return value and the +// non-blocking property is indicated in the corresponding signature definition by means +// of a noblock keyword. Possible exceptions raised by non-blocking procedures have to be +// removed from the port queue by using catch operations in subsequent alt or interleave +// statements. + +module NegSem_220301_CallOperation_006 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_called); + p.call(S:{}) { + [] p.getreply(S:?) {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_006(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4870f9397e1ed91b44f053deb92d7f2a43386a19 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_007.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that signature that are not listed in the port inout and out list cannot be used in call operations + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// a) The call operation shall only be used on procedure-based ports. The type definition +// of the port at which the call operation takes place shall include the procedure name +// in its out or inout list i.e. it shall be allowed to call this procedure at this port. + +module NegSem_220301_CallOperation_007 { + + signature S1() noblock; + signature S2() noblock; + + type port P procedure { + inout S1; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220301_CallOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(S2:{}); // error expected + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_007(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d42d685b2c3eb51bd6c43de180141fcee6251abe --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_008.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that in parameters of a signature used in a call operation cannot contain matching symbols + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// b) All in and inout parameters of the signature shall have a specific value i.e. the use +// of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220301_CallOperation_008 { + + signature S(in integer p_par) noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := ? }; + + testcase TC_NegSem_220301_CallOperation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_008(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47268ea88c09094e371418230816367d5dd72182 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_009.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that in parameters of a signature used in a call operation cannot be omitted + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// b) All in and inout parameters of the signature shall have a specific value i.e. the use +// of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220301_CallOperation_009 { + + signature S(in integer p_par) noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := - }; + + testcase TC_NegSem_220301_CallOperation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_009(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99d8af7af8575e555afc47e1d57a7cb8c123f859 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_010.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that inout parameters of a signature used in a call operation cannot contain matching symbols + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// b) All in and inout parameters of the signature shall have a specific value i.e. the use +// of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220301_CallOperation_010 { + + signature S(inout integer p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := ? }; + + testcase TC_NegSem_220301_CallOperation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1, nowait); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_010(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12385ae3c5500e7b67b4c52cef7bad29a8976041 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_011.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that inout parameters of a signature used in a call operation cannot be omitted + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// b) All in and inout parameters of the signature shall have a specific value i.e. the use +// of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220301_CallOperation_011 { + + signature S(inout integer p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := - }; + + testcase TC_NegSem_220301_CallOperation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1, nowait); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220301_CallOperation_011(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf848ce0651f8649cea5afd256b182d9c5b32a14 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_012.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, missing to clause in case of one-to-many connections + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// e) A to clause shall be present in case of one-to-many connections. + +module NegSem_220301_CallOperation_012 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create; + var integer v_counter := 0; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + p.call(S:{}) { // error expected as the to clause is missing + [] p.getreply(S:?) { + v_counter := v_counter + 1; + if (v_counter < 2) { + repeat; + } else { + setverdict(pass, "Both replies received"); } + } + } + } + + control { + execute(TC_NegSem_220301_CallOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a37384b99e94b1605d0e3a7c9b50f9552a30853e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_013.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that type mismatch error is issued for incorrect call timer values + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// g) CallTimerValue shall be of type float. + +module NegSem_220301_CallOperation_013 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}, 2) { // error expected as 2 is an integer literal + [] p.getreply(S:?) {} + [] p.catch(timeout) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220301_CallOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f45d76b2f000b37374dbda31be59d87bebfc6b6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_014.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that getreply signature mismatch in the response and exception handling causes an error + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// h) The selection of the alternatives to a call shall only be based on getreply and catch operations +// for the called procedure. Unqualified getreply and catch operations shall only treat replies from +// and exceptions raised by the called procedure. + +module NegSem_220301_CallOperation_014 { + + signature S1(); + signature S2(); + + type port P procedure { + inout S1, S2; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S1:?); + p.reply(S1:{}); + } + + testcase TC_NegSem_220301_CallOperation_014() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S1:{}) { + [] p.getreply(S1:?) { setverdict(pass, "Reply accepted"); } + [] p.getreply(S2:?) {} // error expected + } + } + + control { + execute(TC_NegSem_220301_CallOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..660398f72bb7997dacf8248d51226af675ed1872 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_015.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that exception signature mismatch in the response and exception handling causes an error + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// h) The selection of the alternatives to a call shall only be based on getreply and catch operations +// for the called procedure. Unqualified getreply and catch operations shall only treat replies from +// and exceptions raised by the called procedure. + +module NegSem_220301_CallOperation_015 { + + signature S1() exception(integer); + signature S2() exception(charstring); + + type port P procedure { + inout S1, S2; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S1:?); + p.raise(S1, 1); + } + + testcase TC_NegSem_220301_CallOperation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S1:{}) { + [] p.catch(S1, integer:?) { setverdict(pass, "Exception caught!"); } + [] p.catch(S2, charstring:?) {} // expected error + } + } + + control { + execute(TC_NegSem_220301_CallOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9b9dfafc02f65f356f392449784f06374ab9ba8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_016.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that forbidden calls cannot appear in response and exception handling part guards + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// i) The evaluation of the Boolean expressions guarding the alternatives in the response +// and exception handling part may have side effects. In order to avoid unexpected side +// effects, the same rules as for the Boolean guards in alt statements shall be applied +// (see clause 20.2). + + +module NegSem_220301_CallOperation_016 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_016() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + timer t_tmr := 5.0; + t_tmr.start; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}) { + [t_tmr.read > 0.0] p.getreply(S:?) { setverdict(pass, "Reply accepted"); } // guard error expected + } + } + + control { + execute(TC_NegSem_220301_CallOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1a9555e5cd8d22bc639e9fb2e2763e781f1532f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_017.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that forbidden functions cannot appear in response and exception handling part guards + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// i) The evaluation of the Boolean expressions guarding the alternatives in the response +// and exception handling part may have side effects. In order to avoid unexpected side +// effects, the same rules as for the Boolean guards in alt statements shall be applied +// (see clause 20.2). + +module NegSem_220301_CallOperation_017 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + var integer v_int := 0; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + function f_guard() runs on GeneralComp return boolean { + v_int := v_int + 1; + return v_int < 10; + } + + testcase TC_NegSem_220301_CallOperation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}) { + [f_guard()] p.getreply(S:?) { setverdict(pass, "Reply accepted"); } // guard error expected + } + } + + control { + execute(TC_NegSem_220301_CallOperation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31b941d35f4a7626e345d45083e6a5c5cf2b7932 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_018.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that non-blocking procedure calls cannot contain timeout values + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// l) The call operation for a non-blocking procedure shall have no response and exception +// handling part, shall raise no timeout exception and shall not use the nowait keyword. + +module NegSem_220301_CallOperation_018 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_018() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}, 1.0); + alt { + [] p.getreply(S:?) { setverdict(pass, "Reply accepted"); } // guard error expected + } + } + + control { + execute(TC_NegSem_220301_CallOperation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7561c40daf4d31a5cc96c9d83e7f18e98c893105 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_019.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that non-blocking procedure calls cannot contain nowait parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// l) The call operation for a non-blocking procedure shall have no response and exception +// handling part, shall raise no timeout exception and shall not use the nowait keyword. + +module NegSem_220301_CallOperation_019 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220301_CallOperation_019() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}, nowait); + alt { + [] p.getreply(S:?) { setverdict(pass, "Reply accepted"); } // guard error expected + } + } + + control { + execute(TC_NegSem_220301_CallOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_020.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2085d833fe7d17bb243cb64519fa79adb493dda2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSem_220301_CallOperation_020.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that calls cannot be used on disconnected ports + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// m) Applying a call operation to an unmapped or disconnected port shall cause a test +// case error. + +module NegSem_220301_CallOperation_020 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220301_CallOperation_020() runs on GeneralComp system GeneralComp { + p.call(S:{}); + } + + control { + execute(TC_NegSem_220301_CallOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb0e9c22441f1ddc679acefc5b878c2002b7d9a3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_001.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that the response and exception handling part cannot contain an else clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// h) The use of else branches and the invocation of altsteps is not allowed. + +module NegSyn_220301_CallOperation_001 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSyn_220301_CallOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}) { + [] p.getreply(S:?) { setverdict(pass); } + [else] {} // expected error + } + } + + control { + execute(TC_NegSyn_220301_CallOperation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d65ceab6a612a1c2593f4fc989c20927a05707e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/NegSyn_220301_CallOperation_002.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that the response and exception handling part cannot contain an altstep + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// h) The use of else branches and the invocation of altsteps is not allowed. + +module NegSyn_220301_CallOperation_002 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + altstep a_handleReply() runs on GeneralComp { + [] p.getreply {} + } + + testcase TC_NegSyn_220301_CallOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}) { + [] p.getreply(S:?) { setverdict(pass); } + [] a_handleReply() {} // expected error + } + } + + control { + execute(TC_NegSyn_220301_CallOperation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c89ee28341bcc4c82ca1e50e167a865d2171cc2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_001.ttcn @@ -0,0 +1,120 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles procedure call operations + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220301_CallOperation_001 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_001 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_001 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_001; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_Sem_220301_CallOperation_001:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220301_CallOperation_001:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_001:s_returnTemplate value 2) { + setverdict(fail); + } + [v_one>v_zero] PCO.getreply(p_Sem_220301_CallOperation_001:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220301_CallOperation_001 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_001:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_001:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220301_CallOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fc77bf78e6ae7c96d9134019fdd07729c26b2c9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_002.ttcn @@ -0,0 +1,120 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles procedure call operations + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220301_CallOperation_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_Sem_220301_CallOperation_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220301_CallOperation_002:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_002:s_returnTemplate value 2) { + setverdict(fail); + } + [v_one param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220301_CallOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1d08cd10a460b8d6c5a274e41d082a080723f7cb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_003.ttcn @@ -0,0 +1,124 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles non-blocking procedure call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220301_CallOperation_003 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_003(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_003 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_003 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_003 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_003; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + timer t_timer:=5.0; + + PCO.call(p_Sem_220301_CallOperation_003:s_callTemplate, nowait); //check non-blocking call + t_timer.start; + + alt { + + [] PCO.getreply(p_Sem_220301_CallOperation_003:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_003:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_003:s_returnTemplate value 1) { + setverdict(pass); + } + [] t_timer.timeout { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220301_CallOperation_003 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_003:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_003:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220301_CallOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9720c1ffff6d864d86ba7b05557e3efe093976af --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_004.ttcn @@ -0,0 +1,120 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles multiple client calls to the same server + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220301_CallOperation_004 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_004(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + + template p_Sem_220301_CallOperation_004 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_004 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_004 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_004; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + var boolean first:=true; + + PCO.call(p_Sem_220301_CallOperation_004:s_callTemplate, 5.0) { + + [first] PCO.getreply(p_Sem_220301_CallOperation_004:s_returnTemplate value 1) { + first:=false; + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail, "Component did not receive a response"); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + var GeneralComp v_clientAddress; + var integer v_par1; + var integer v_par3; + timer t_timeout:=2.0; + + template p_Sem_220301_CallOperation_004 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_004:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_clientAddress { + PCO.reply(p_Sem_220301_CallOperation_004:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to v_clientAddress; //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + testcase TC_Sem_220301_CallOperation_004() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server:PCO, client2:PCO); + + server.start(f_ServerResponses()); + + client.start(f_ClientQuery()); + client2.start(f_ClientQuery()); + + interleave { + [] client.done {} + [] client2.done {} + } + server.stop; + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_004(), 30.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46efb4b6c78e944213b5df7141045ebf5476320c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_005.ttcn @@ -0,0 +1,123 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.1, blocking broadcast call with no response and exception handling part + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Like for the send operation, TTCN-3 also supports unicast, multicast and broadcast calls +// of procedures. This can be done in the same manner as described in clause 22.2.1, i.e. +// the argument of the to clause of a call operation is for unicast calls the address of +// one receiving entity (or can be omitted in case of one-to-one connections), for multicast +// calls a list of addresses of a set of receivers and for broadcast calls the all component +// keyword. + +module Sem_220301_CallOperation_005 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_005(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_005 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_005 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_005 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_005; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_counter := 0; + + // validate broadcast calling + PCO.call(p_Sem_220301_CallOperation_005:s_callTemplate, nowait) to all component; + + alt { + // check that we get a reply from both servers + [] PCO.getreply(p_Sem_220301_CallOperation_005:s_returnTemplate value 1) { + v_counter := v_counter + 1; + if (v_counter == 2) { + setverdict(pass, "Server1 reply received"); + } else { + repeat; + } + } + } + } + + template p_Sem_220301_CallOperation_005 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + function f_ServerResponses() runs on GeneralComp { + var integer v_par1; + var integer v_par3; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_005:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_005:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); + repeat; + } + } + } + + testcase TC_Sem_220301_CallOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service") alive; + var GeneralComp server2 := GeneralComp.create("RemoteProcedure Service2") alive; + var GeneralComp client := GeneralComp.create("RemoteProcedure Client") alive; + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server2:PCO, client:PCO); + + // set server address and start operation + server.start(f_ServerResponses()); + server2.start(f_ServerResponses()); + + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + server2.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + disconnect(server2:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_005(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37de581cc66b3bc3a1c58052502bf7b20116174e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_006.ttcn @@ -0,0 +1,118 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.1, blocking multicast call with no response and exception handling part + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// Like for the send operation, TTCN-3 also supports unicast, multicast and broadcast calls +// of procedures. This can be done in the same manner as described in clause 22.2.1, i.e. +// the argument of the to clause of a call operation is for unicast calls the address of +// one receiving entity (or can be omitted in case of one-to-one connections), for multicast +// calls a list of addresses of a set of receivers and for broadcast calls the all component +// keyword. + +module Sem_220301_CallOperation_006 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_006(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_006 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_006 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_006 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_006; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery(GeneralComp server1, GeneralComp server2) runs on GeneralComp { + // validate multicast calling + PCO.call(p_Sem_220301_CallOperation_006:s_callTemplate, nowait) to (server1, server2); + interleave { + //check that we get a reply from first server + [] PCO.getreply(p_Sem_220301_CallOperation_006:s_returnTemplate value 1) from server1 { + setverdict(pass, "Reply from server 1"); + } + [] PCO.getreply(p_Sem_220301_CallOperation_006:s_returnTemplate value 1) from server2 { + setverdict(pass, "Reply from server 2"); + } + } + } + + template p_Sem_220301_CallOperation_006 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + function f_ServerResponses() runs on GeneralComp { + var integer v_par1; + var integer v_par3; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_006:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_006:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); + repeat; + } + } + + } + + testcase TC_Sem_220301_CallOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp server1 := GeneralComp.create("RemoteProcedure Service") alive; + var GeneralComp server2 := GeneralComp.create("RemoteProcedure Service2") alive; + var GeneralComp client := GeneralComp.create("RemoteProcedure Client") alive; + // map the PTCs to the system port + connect(server1:PCO, client:PCO); + connect(server2:PCO, client:PCO); + + // set server address and start operation + server1.start(f_ServerResponses()); + server2.start(f_ServerResponses()); + + client.start(f_ClientQuery(server1, server2)); + + alt { + [] client.done { + server1.stop; + server2.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server1:PCO); + disconnect(server2:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_006(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b74576f332f11960f769bf8406c7984f2eee8d54 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_007.ttcn @@ -0,0 +1,120 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.1, Ensure that the IUT correctly handles blocking procedure call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220301_CallOperation_007 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220301_CallOperation_007(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220301_CallOperation_007 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220301_CallOperation_007 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220301_CallOperation_007 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220301_CallOperation_007; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_Sem_220301_CallOperation_007:s_callTemplate,5.0) { //blocking version of procedure call + + [] PCO.getreply(p_Sem_220301_CallOperation_007:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_007:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220301_CallOperation_007:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch(timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220301_CallOperation_007 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220301_CallOperation_007:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220301_CallOperation_007:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220301_CallOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220301_CallOperation_007()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c55521970b850014179e1202416ba74e589cdaa7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_008.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that defaults are not executed in response and exception handling part of a call operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The response and exception handling part of a call operation is executed like an alt +// statement without any active default. + +module Sem_220301_CallOperation_008 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + timer t_tmr := 1.0; + p.getcall(S:?); + t_tmr.start; + t_tmr.timeout; + p.reply(S:{}); + } + + altstep a_timeout() runs on GeneralComp { + [] any timer.timeout { setverdict(fail, "Timer timeout"); } + } + + testcase TC_Sem_220301_CallOperation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + timer t_tmr := 0.1; + t_tmr.start; + activate(a_timeout()); // activates a default which shouldn't be triggered in the call block + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}, 4.0) { // the local t_tmr timer should time out first, because the reply is delayed + [] p.getreply(S:?) { setverdict(pass, "Reply received"); } + [] p.catch(timeout) { setverdict(fail, "Call timeout"); } + } + setverdict(pass); + } + + control { + execute(TC_Sem_220301_CallOperation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02d3b4fb82e42f0fdde4f126cd358ace26e180b1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_009.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, blocking call with no timeout + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// The call operation may optionally include a timeout. + +module Sem_220301_CallOperation_009 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}) { + [] p.getreply(S:?) { setverdict(pass, "Reply received"); } + } + } + + control { + execute(TC_Sem_220301_CallOperation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..508bdc190ccb35baf1f64b6813c5daed61676af7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_010.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, blocking broadcast call with response and exception handling part and subsequent alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a blocking procedure, two options exist. Either, +// only one response or exception is handled in the response and exception handling part of the call +// operation. Then, further responses and exceptions can be handled in subsequent alt or interleave +// statements. + +module Sem_220301_CallOperation_010 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + p.call(S:{}) to all component { + [] p.getreply(S:?) { setverdict(pass, "First reply received"); } // first reply + } + alt { + [] p.getreply(S:?) { setverdict(pass, "Second reply received"); } // second reply + } + } + + control { + execute(TC_Sem_220301_CallOperation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19ce842ecc2be7b0a6aa5f7fff07bef355440bf0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_011.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, blocking broadcast call with response and exception handling part handling all replies + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a blocking procedure, two options exist. +// [2nd option:] +// Several responses or exceptions are handled by the use of repeat statements in one or more of the +// statement blocks of the response and exception handling part of the call operation: the execution +// of a repeat statement causes the re-evaluation of the call body. + +module Sem_220301_CallOperation_011 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create; + var integer v_counter := 0; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + p.call(S:{}) to all component { + [] p.getreply(S:?) { + v_counter := v_counter + 1; + if (v_counter < 2) { + repeat; + } else { + setverdict(pass, "Both replies received"); } // expected result + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d57e9ff70aa7fddd6831e9dde233da9524b6e1eb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_012.ttcn @@ -0,0 +1,65 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, blocking multicast call with response and exception handling part and subsequent alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a blocking procedure, two options exist. Either, +// only one response or exception is handled in the response and exception handling part of the call +// operation. Then, further responses and exceptions can be handled in subsequent alt or interleave +// statements. + +module Sem_220301_CallOperation_012 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create, + v_ptc3 := GeneralComp.create, + v_comp; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + connect(self:p, v_ptc3:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + v_ptc3.start(f_called()); + p.call(S:{}) to (v_ptc1, v_ptc3) { + [] p.getreply(S:?) -> sender v_comp { + if (v_comp == v_ptc1 or v_comp == v_ptc3) { + setverdict(pass, "First reply received"); + } else { + setverdict(fail, "Wrong component"); + } + } + } + alt { + [] p.getreply(S:?) -> sender v_comp { + if (v_comp == v_ptc1 or v_comp == v_ptc3) { + setverdict(pass, "Second reply received"); + } else { + setverdict(fail, "Wrong component"); + } + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3d1754d24a035679a5a28d683028f0cf9eb7614 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_013.ttcn @@ -0,0 +1,63 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, blocking multicast call with response and exception handling part handling all replies + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a blocking procedure, two options exist. +// [2nd option:] +// Several responses or exceptions are handled by the use of repeat statements in one or more of the +// statement blocks of the response and exception handling part of the call operation: the execution +// of a repeat statement causes the re-evaluation of the call body. + +module Sem_220301_CallOperation_013 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create, + v_ptc3 := GeneralComp.create, + v_comp; + var integer v_counter := 0; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + connect(self:p, v_ptc3:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + v_ptc3.start(f_called()); + p.call(S:{}) to (v_ptc1, v_ptc3) { + [] p.getreply(S:?) -> sender v_comp { + if (v_comp == v_ptc1 or v_comp == v_ptc3) { + v_counter := v_counter + 1; + if (v_counter < 2) { + repeat; + } else { + setverdict(pass, "Both replies received"); // expected result + } + } else { + setverdict(fail, "Wrong component"); + } + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc1a2299f63138361d6fbc827170d39099dfe73c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_014.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, non-blocking broadcast call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a non-blocking procedure, all exceptions which +// may be raised from the different communication partners can be handled in subsequent catch, alt or +// interleave statements. + +module Sem_220301_CallOperation_014 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_014() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create; + var integer v_counter := 0; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + p.call(S:{}) to all component; + alt { + [] p.getreply(S:?) { + v_counter := v_counter + 1; + if (v_counter < 2) { + repeat; + } else { + setverdict(pass, "Both replies received"); // both replies received + } + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fb8e416449316c5c61ada75cdcfc15b3904d303 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_015.ttcn @@ -0,0 +1,62 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, non-blocking multicast call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of a multicast or broadcast call operation of a non-blocking procedure, all exceptions which +// may be raised from the different communication partners can be handled in subsequent catch, alt or +// interleave statements. + +module Sem_220301_CallOperation_015 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, + v_ptc2 := GeneralComp.create, + v_ptc3 := GeneralComp.create, + v_comp; + var integer v_counter := 0; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + connect(self:p, v_ptc3:p); + v_ptc1.start(f_called()); + v_ptc2.start(f_called()); + v_ptc3.start(f_called()); + p.call(S:{}) to (v_ptc1, v_ptc3); + alt { + [] p.getreply(S:?) -> sender v_comp { + if (v_comp == v_ptc1 or v_comp == v_ptc3) { + v_counter := v_counter + 1; + if (v_counter < 2) { + repeat; + } else { + setverdict(pass, "Both replies received"); // success + } + } else { + setverdict(fail, "Wrong component"); + } + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3dd463e47daaee6016bb528e315345442b33a22d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_016.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, non-blocking unicast call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case of non-blocking procedure-based communication the handling of exceptions to call operations +// is done by using catch (see clause 22.3.6) operations as alternatives in alt statements. + +module Sem_220301_CallOperation_016 { + + signature S() noblock; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220301_CallOperation_016() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S:{}); + alt { + [] p.getreply(S:?) { + setverdict(pass, "Reply received"); // success: reply received + } + } + } + + control { + execute(TC_Sem_220301_CallOperation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56d570ba72176f07c482ef786aed9bd6429ad560 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_017.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that out parameters of a signature used in a call operation can be omitted + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// c) Only out parameters may be omitted or specified with a matching attribute. + +module Sem_220301_CallOperation_017 { + + signature S(out integer p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := - }; + + testcase TC_Sem_220301_CallOperation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1, nowait); + setverdict(pass); + } + + control{ + execute(TC_Sem_220301_CallOperation_017(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4cf6a0656c6fd9b27dc121a580d4d2f9aa93cd1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_018.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that out parameters of a signature used in a call operation can contain matching symbols + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// c) Only out parameters may be omitted or specified with a matching attribute. + +module Sem_220301_CallOperation_022 { + + signature S(out integer p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + template S s_signature1 := { p_par := ? }; + + testcase TC_Sem_220301_CallOperation_022() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + p.call(s_signature1, nowait); + setverdict(pass); + } + + control{ + execute(TC_Sem_220301_CallOperation_022(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b019d602c228253ac843c106f78e1bfe3935343c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_019.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that replies that are not related to the actual call are ignored in unqualified getreply statements + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// h) The selection of the alternatives to a call shall only be based on getreply and catch operations +// for the called procedure. Unqualified getreply and catch operations shall only treat replies from +// and exceptions raised by the called procedure. + +module Sem_220301_CallOperation_019 { + + signature S1() noblock; + signature S2(); + + type port P procedure { + inout S1, S2; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S1:?); + p.getcall(S2:?); + p.reply(S1:{}); + p.reply(S2:{}); + } + + testcase TC_Sem_220301_CallOperation_019() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S1:{}); // non-blocking call (but the script "forgets" to handle the reply - this should clog the port + p.call(S2:{}, 1.0) { + [] p.getreply { setverdict(fail, "The reply is not the expected one!"); } // this one should receive only S2 replies, but there's S1 in the port queue + [] p.catch(timeout) { setverdict(pass, "Timeout as expected"); } + } + } + + control { + execute(TC_Sem_220301_CallOperation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_020.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5449f584109b61127a5c9806a27c017dbbff2da3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220301_call_operation/Sem_220301_CallOperation_020.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.1, verify that exceptions that are not related to the actual call are ignored in unqualified catch statements + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// h) The selection of the alternatives to a call shall only be based on getreply and catch operations +// for the called procedure. Unqualified getreply and catch operations shall only treat replies from +// and exceptions raised by the called procedure. + +module Sem_220301_CallOperation_020 { + + signature S1() noblock exception(integer); + signature S2() exception(charstring); + + type port P procedure { + inout S1, S2; + } + + type component GeneralComp { + port P p; + } + + function f_called() runs on GeneralComp { + p.getcall(S1:?); + p.getcall(S2:?); + p.raise(S1, 1); + p.raise(S2, "exc"); + } + + testcase TC_Sem_220301_CallOperation_020() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f_called()); + p.call(S1:{}); // non-blocking call (but the script "forgets" to handle the exception - this should clog the port + p.call(S2:{}, 1.0) { + [] p.catch { setverdict(fail, "The exception is not the expected one!"); } // this one should receive only S2 exceptions, but there's S1 in the port queue + [] p.catch(timeout) { setverdict(pass, "Timeout as expected"); } + } + } + + control { + execute(TC_Sem_220301_CallOperation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e05b09536681592bb8014be5bad241eb25e14870 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall operations are only used on procedure based ports + ** @verdict pass reject + ***************************************************/ + +module NegSem_220302_GetcallOperation_001 { + + + type port loopbackPort message { + inout integer + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + testcase TC_NegSem_220302_GetcallOperation_001() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] messagePort.getcall { //cannot use getcall on a message based port + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + } + + control{ + execute(TC_NegSem_220302_GetcallOperation_001()); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f85cf8bbb2cfc4c5124f67581a4c5fe3c82795a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_002.ttcn @@ -0,0 +1,123 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall operation does not allow value assignment + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220302_GetcallOperation_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_NegSem_220302_GetcallOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_NegSem_220302_GetcallOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_NegSem_220302_GetcallOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_NegSem_220302_GetcallOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_NegSem_220302_GetcallOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_NegSem_220302_GetcallOperation_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_NegSem_220302_GetcallOperation_002:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220302_GetcallOperation_002:s_returnTemplate value 2) { + setverdict(fail); + } + [v_one>v_zero] PCO.getreply(p_NegSem_220302_GetcallOperation_002:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + var integer v_return; + timer t_timeout:=30.0; + + template p_NegSem_220302_GetcallOperation_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_NegSem_220302_GetcallOperation_001:s_acceptTemplate) -> value v_return { //not allowed assignment + } + [] t_timeout.timeout { + } + } + + } + + + testcase TC_NegSem_220302_GetcallOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + timer t_wait:=1.0; + + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + t_wait.start; + while(t_wait.running) { //this gives a chance for server to still test for second getcall match + } + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_220302_GetcallOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62f3fc3faaad44f378c3d22c6ea1a34693a5f7aa --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_GetcallOperation_003.ttcn @@ -0,0 +1,122 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall for any call does not allow param assignment + ** @verdict pass reject + *****************************************************************/ + +module NegSem_220302_GetcallOperation_003 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_NegSem_220302_GetcallOperation_003(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_NegSem_220302_GetcallOperation_003 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_NegSem_220302_GetcallOperation_003 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_NegSem_220302_GetcallOperation_003 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_NegSem_220302_GetcallOperation_003; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_NegSem_220302_GetcallOperation_003:s_callTemplate, 5.0) { + + [] PCO.getreply(p_NegSem_220302_GetcallOperation_003:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_NegSem_220302_GetcallOperation_003:s_returnTemplate value 2) { + setverdict(fail); + } + [v_one>v_zero] PCO.getreply(p_NegSem_220302_GetcallOperation_003:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_NegSem_220302_GetcallOperation_003 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall -> param(v_par1, - , v_par3) { //not allowed param assignment for any call + } + [] t_timeout.timeout { + } + } + + } + + + testcase TC_NegSem_220302_GetcallOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + timer t_wait:=1.0; + + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + t_wait.start; + while(t_wait.running) { //this gives a chance for server to still test for second getcall match + } + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_NegSem_220302_GetcallOperation_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7bd7ba12f94bdfbd9c8c03a44a6c1140fac4cd52 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_004.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when any from getcall is applied to single port + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// The PortArrayRef shall be a reference to a port array variable identifier. +module NegSem_220302_getcall_operation_004 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var integer v_index; + alt + { + [] any from p.getcall { setverdict(pass); } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSem_220302_getcall_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb90966213848eb3bbbeebb4eb53717f762fe801 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_005.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when any from getcall is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220302_getcall_operation_005 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index[1]; + alt + { + [] any from p.getcall(S:?) -> @index value v_index { + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSem_220302_getcall_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{}, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..abe4a6d5df3d162d23fa1a6a10f95f28ead8602d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_006.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when any from getcall is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220302_getcall_operation_006 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + var float v_index; + alt + { + [] any from p.getcall(S:?) -> @index value v_index { + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSem_220302_getcall_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{}, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..63b446f428d6972958cd81305d1d9e2f2520fe69 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_007.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220302_getcall_operation_007 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index[1], v_parValue; + var GeneralComp v_src; + alt + { + [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + + testcase TC_NegSem_220302_getcall_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].call(S:{ p_par := i + 1 }, nowait); } + } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88fc2c286e5b28fb5afbbce2d36732563d1e50be --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_008.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220302_getcall_operation_008 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index, v_parValue; + var GeneralComp v_src; + alt + { + [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> param (v_parValue := p_par) sender v_src @index value v_index { + if(v_index == 1 and v_parValue == v_index + 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSem_220302_getcall_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].call(S:{ p_par := i + 1 }, nowait); } + } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSem_220302_getcall_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d0edaaca1eaf30ccdb468f75d3039122a4763d5 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_009.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.2, null component in the from clause of the getcall operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220302_getcall_operation_009 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var GeneralComp v_compRef := null; + alt { + [] p.getcall(S:{}) from v_compRef {} // error expected + [] p.getcall(S:{}) {} + } + } + + testcase TC_NegSem_220302_getcall_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..759427c92616d56baee9fa4fc34a2907cd5d12da --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_010.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.2, null component in the multicast list of the from clause of the getcall operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220302_getcall_operation_010 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var GeneralComp v_compRef := null; + alt { + [] p.getcall(S:{}) from (mtc, v_compRef) {} // error expected + } + } + + testcase TC_NegSem_220302_getcall_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7e76b647f03d986df39852a4670db205d0aec44 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_011.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, applying @decoded to a forbidden field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a message, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220302_getcall_operation_011 { + type record of integer RoI (0..255); + + signature S(RoI p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_NegSem_220302_getcall_operation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := { 0, 0, 0, 0 } }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48575d26924fab4d8e25845de1069075dc933dfb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_012.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, decoding error in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Failure of this decoding shall cause a test case error. + +module NegSem_220302_getcall_operation_012 { + signature S(charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getcall { setverdict(pass); } + } + } + + testcase TC_NegSem_220302_getcall_operation_012() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src) & "abcdefgij"; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..37cedc075e948f6013e1be1bf78817e0de00a057 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_013.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, invalid format value in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220302_getcall_operation_013 { + signature S(universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded("proprietary") p_par) { + setverdict(pass); + } + [] p.getcall { setverdict(pass); } + } + } + + testcase TC_NegSem_220302_getcall_operation_013() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30b9e8cd9c2d4a872e705b834ada80ac7f11ad05 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_014.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, value of wrong type in @decoded redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220302_getcall_operation_014 { + signature S(universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res, v_enc := 32 with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded(v_enc) p_par) { + setverdict (pass); + } + [] p.getcall { setverdict(pass); } + } + } + + testcase TC_NegSem_220302_getcall_operation_014() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..740cafa9f7ad688dc29911b25626ba84df818e24 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_015.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, encoding parameter of @decoded redirect assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220202_ReceiveOperation_009 { + signature S(octetstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_res; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded("UTF-8") p_par) { + setverdict(pass); + } + [] p.getcall { setverdict(pass); } + } + } + + testcase TC_NegSem_220302_getcall_operation_015() runs on GeneralComp system GeneralComp { + var charstring v_src := "abc"; + var octetstring v_os := bit2oct(encvalue(v_src)); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_os }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..84a6205952789a2574447f0b5f397424e98093f8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_016.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, incompatible from and sender clause in getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the getcall operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_220302_getcall_operation_016 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + var GeneralComp v_compRef := null; + alt { + [] p.getcall(S:{}) from AltComp:? -> sender v_compRef { } // error expected + [] p.getcall(S:{}) { } + } + setverdict (pass); + } + + testcase TC_NegSem_220302_getcall_operation_016() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12548b02e48e6b26c5b75dbf064122b5a50b7ec1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_017.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.2, incompatible decmatch and @decoded value redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded parameters (by using the @decoded modifier) +// in cases where the value or template to be matched uses the MatchDecodedContent +// (decmatch) matching for the parameter to be stored, the type of the template in +// the MatchDecodedContent matching shall be type-compatible to the type of the +// variable the decoded field is stored into. + +module NegSem_220302_getcall_operation_017 { + signature S(bitstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type record Wrapped { + integer num + } + + function f_server() runs on GeneralComp { + var Wrapped v_res; + alt { + [] p.getcall(S:{ p_par := decmatch integer:? }) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getcall { setverdict(pass); } + } + } + + testcase TC_NegSem_220302_getcall_operation_017() runs on GeneralComp system GeneralComp { + var integer v_src := 5; + var bitstring v_bs := encvalue(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_bs }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b001c5467501390eba6781d171aee8ff63fdf26 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_018.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:22.3.2, incompatible template in the from clause of the getcall operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// f) All AddressRef items in the from clause and all VariableRef items in the sender clause +// shall be of type address, component or of the address type bound to the port type (see +// section 6.2.9) of the port instance referenced in the getcall operation. + +module NegSem_220302_getcall_operation_021 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.call(S:{}, nowait); + } + + testcase TC_NegSem_220302_getcall_operation_021() runs on GeneralComp system GeneralComp { + var charstring v_addr := "addr"; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + alt { + [] p.getcall(S:?) from v_addr {} // error expected + [] p.getcall {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f460e2f43870397f0ba84af32ea80692091ecd31 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSem_220302_getcall_operation_019.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.2, trying to store an incompatible component value in the sender clause of a getcall operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// l) If the operation contains a sender clause but no from clause, the sender shall be type +// compatible with the type of the variable or parameter referenced in the sender clause. + +module NegSem_220302_getcall_operation_019 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + var AltComp v_compRef := null; + alt { + [] p.getcall(S:{}) -> sender v_compRef { } // error expected + [] p.getcall(S:{}) { } + } + setverdict (pass); + } + + testcase TC_NegSem_220302_getcall_operation_019() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220302_getcall_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f57d33ae4e8f8336ed0d56c2bc4e89f4eb92723 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_001.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when using index redirection in port.getcall operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220302_getcall_operation_001 { + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var integer v_index; + alt + { + [] p.getcall -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSyn_220302_getcall_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSyn_220302_getcall_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cfd3ae696dab8b570321b385bff0470cc5623e83 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/NegSyn_220302_getcall_operation_002.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that error occurs when using index redirection in any port.getcall operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220302_getcall_operation_002 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var integer v_index; + alt + { + [] any port.getcall -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_NegSyn_220302_getcall_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_NegSyn_220302_getcall_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4600c7c77df3526b12a9c9396ca7f370eca8d590 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_001.ttcn @@ -0,0 +1,126 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall operations remove only matching procedure from the queue + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220302_GetcallOperation_001 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220302_GetcallOperation_001(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220302_GetcallOperation_001 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220302_GetcallOperation_001 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220302_GetcallOperation_001 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220302_GetcallOperation_001; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_220302_GetcallOperation_001:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220302_GetcallOperation_001:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220302_GetcallOperation_001:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220302_GetcallOperation_001:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220302_GetcallOperation_001 s_noacceptTemplate := { + p_par1 := 8, + p_par2 := 8, + p_par3 := 8 + }; + + template p_Sem_220302_GetcallOperation_001 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220302_GetcallOperation_001:s_noacceptTemplate) { //should not remove incoming procedure + repeat; + } + [] PCO.getcall(p_Sem_220302_GetcallOperation_001:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220302_GetcallOperation_001:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220302_GetcallOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220302_GetcallOperation_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0ca5213a4a8f42b5eb3b05aeecb96c9dd031841c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_002.ttcn @@ -0,0 +1,132 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall operations remove the matching procedure from the queue + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220302_GetcallOperation_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220302_GetcallOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220302_GetcallOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220302_GetcallOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220302_GetcallOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220302_GetcallOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + + PCO.call(p_Sem_220302_GetcallOperation_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_returnTemplate value 2) { + setverdict(fail); + } + [v_one>v_zero] PCO.getreply(p_Sem_220302_GetcallOperation_002:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220302_GetcallOperation_002 s_noacceptTemplate := { + p_par1 := 8, + p_par2 := 8, + p_par3 := 8 + }; + + template p_Sem_220302_GetcallOperation_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220302_GetcallOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) { + PCO.reply(p_Sem_220302_GetcallOperation_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); //procedure return values are sent + repeat; + } + [] PCO.getcall { //this part is not matched if procedure is removed from queue + setverdict(fail); + } + [] t_timeout.timeout { + } + } + + } + + + testcase TC_Sem_220302_GetcallOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + timer t_wait:=1.0; + + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + t_wait.start; + t_wait.timeout; //this gives a chance for server to still test for second getcall match + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220302_GetcallOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea9cee721d7383d366af2d82496bd11b06428f71 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_003.ttcn @@ -0,0 +1,134 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that the getcall operation can be correctly restricted to a certain client + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220302_GetcallOperation_003 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220302_GetcallOperation_003(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + + template p_Sem_220302_GetcallOperation_003 s_returnTemplate1 := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220302_GetcallOperation_003 s_returnTemplate2 := { + p_par1 := -, + p_par2 := 5, + p_par3 := 6 + } + + template p_Sem_220302_GetcallOperation_003 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220302_GetcallOperation_003 s_callTemplate(in integer i) := { + p_par1 := i, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220302_GetcallOperation_003; + } + + type component GeneralComp { + var GeneralComp v_clientAddress; + port remotePort PCO; + } + + function f_ClientQuery(in integer p_i) runs on GeneralComp { + var boolean first:=true; + + PCO.call(p_Sem_220302_GetcallOperation_003:s_callTemplate(p_i), 5.0) { + + [first] PCO.getreply(s_returnTemplate1) { + first:=false; + } + [first] PCO.getreply(s_returnTemplate2) { + first:=false; + } + [] PCO.catch (timeout) { + // done + } + } + } + + function f_ServerResponses(in GeneralComp p_client) runs on GeneralComp { + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + var boolean client1_received := false; + var boolean client2_received := false; + + template p_Sem_220302_GetcallOperation_003 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + + alt { + [not client1_received] PCO.getcall(p_Sem_220302_GetcallOperation_003:s_acceptTemplate) from p_client -> param(v_par1, - , v_par3) sender v_clientAddress { + PCO.reply(p_Sem_220302_GetcallOperation_003:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to v_clientAddress; //procedure return values are sent + setverdict(pass, "p_client got a message"); + client1_received := true; + if (not client2_received) { + repeat; + } + } + [not client2_received] PCO.getcall(p_Sem_220302_GetcallOperation_003:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_clientAddress { + PCO.reply(p_Sem_220302_GetcallOperation_003:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to v_clientAddress; //procedure return values are sent + // response for other clients + client2_received := true; + if (not client1_received) { + repeat; + } + } + [] t_timeout.timeout { + setverdict(fail, "server received not enough messages: client 1 message received ",client1_received, " client 2 message received ",client2_received); + } + } + + } + + testcase TC_Sem_220302_GetcallOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client 1"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client 2"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server:PCO, client2:PCO); + + server.start(f_ServerResponses(client)); + client.start(f_ClientQuery(1)); + client2.start(f_ClientQuery(2)); + + client.done; + client2.done; + server.stop; + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220302_GetcallOperation_003(), 5.0); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7e17c4cd57d437628af291c549fad8f70e9d6bd3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_004.ttcn @@ -0,0 +1,128 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that the getcall operation can be correctly restricted to a certain client + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220302_GetcallOperation_004 { + + type charstring address; + const address c_client1Addr := "client1Addr"; + const address c_client2Addr := "client2Addr"; + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220302_GetcallOperation_004(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + + template p_Sem_220302_GetcallOperation_004 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220302_GetcallOperation_004 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220302_GetcallOperation_004 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220302_GetcallOperation_004; + } + + type component GeneralComp { + port remotePort PCO; + var GeneralComp v_myAddress; + } + + function f_ClientQuery(GeneralComp p_myAddress) runs on GeneralComp { + var integer v_zero:=0; + var integer v_one:=1; + var boolean first:=true; + v_myAddress := p_myAddress; + + PCO.call(p_Sem_220302_GetcallOperation_004:s_callTemplate, 3.0) { + + [first] PCO.getreply(p_Sem_220302_GetcallOperation_004:s_returnTemplate value 1) { + first:=false; + setverdict(fail); //receiving a reply is not expected for client2 query + } + [] PCO.catch (timeout) { + setverdict(pass); + } + } + } + + function f_ServerResponses(GeneralComp p_clientAddress) runs on GeneralComp { + var GeneralComp v_clientAddress; + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220302_GetcallOperation_004 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] PCO.getcall(p_Sem_220302_GetcallOperation_004:s_acceptTemplate) from p_clientAddress -> param(v_par1, - , v_par3) sender v_clientAddress { + PCO.reply(p_Sem_220302_GetcallOperation_004:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to v_clientAddress; //procedure return values are sent + repeat; + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + function f_setAddress(GeneralComp p_myAddress) runs on GeneralComp { + v_myAddress := p_myAddress; + } + + testcase TC_Sem_220302_GetcallOperation_004() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server:PCO, client2:PCO); + + server.start(f_ServerResponses(client)); + client.start(f_setAddress(client)); + client2.start(f_ClientQuery(client)); + + interleave { + [] client.done {} + [] client2.done {} + } + server.stop; + + all component.done; + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220302_GetcallOperation_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..149ca456ae5b82dac262750b5d42ff90affb742e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_GetcallOperation_005.ttcn @@ -0,0 +1,117 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Ensure that getcall operations work with any port attribute + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220302_GetcallOperation_005 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220302_GetcallOperation_005(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + template p_Sem_220302_GetcallOperation_005 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220302_GetcallOperation_005 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220302_GetcallOperation_005 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220302_GetcallOperation_005; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_220302_GetcallOperation_005:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220302_GetcallOperation_005:s_wrongTemplate value 1) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220302_GetcallOperation_005:s_returnTemplate value 2) { + setverdict(fail); + } + [] PCO.getreply(p_Sem_220302_GetcallOperation_005:s_returnTemplate value 1) { //check that boolean guard is correctly evaluated + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220302_GetcallOperation_005 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [] any port.getcall(p_Sem_220302_GetcallOperation_005:s_acceptTemplate) -> param(v_par1, - , v_par3) { //validates getcall on any port + PCO.reply(p_Sem_220302_GetcallOperation_005:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1); + } + [] t_timeout.timeout { + setverdict(fail); + } + } + + } + + + testcase TC_Sem_220302_GetcallOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + + server.start(f_ServerResponses()); + client.start(f_ClientQuery()); + + alt { + [] client.done { + server.stop; + } + } + + alt { + [] all component.done {} + } + + disconnect(server:PCO); + } + + control{ + execute(TC_Sem_220302_GetcallOperation_005()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a928dd7f4b7fa358e53fd1d611fe3130dd6f8c5e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_006.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall is not triggered if there hasn't been any call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To getcall on any port from a specific port array, use the any from PortArrayRef syntax where +// PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220302_getcall_operation_006 { + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + alt + { + [] any from p.getcall { setverdict(fail, "The any from getcall operation produced incorrect match"); } + [else] { setverdict(pass); } + } + } + + testcase TC_Sem_220302_getcall_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb041c1c2b25ae9ae17b508c7552178706c5dbc1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_007.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall matches if at least one port contains enqueued call + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To getcall on any port from a specific port array, use the any from PortArrayRef syntax where +// PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220302_getcall_operation_007 { + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + alt + { + [] any from p.getcall { setverdict(pass); } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_Sem_220302_getcall_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + } + p[1].call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fdecd87682827e19564b407c5849383fa08253c1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_008.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall doesn't assign index when there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220302_getcall_operation_008 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index; + alt + { + [] any from p.getcall(S:{p_par := (1..10)}) -> @index value v_index { + setverdict(fail, "The any from getcall operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + testcase TC_Sem_220302_getcall_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 100 }, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_008(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f748547c286f4b01be7236c6143d59b6bb51fe82 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_009.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall doesn't change index variable when no there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220302_getcall_operation_009 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index := 99; + var GeneralComp v_src; + alt + { + [] any from p.getcall(S:{p_par := (1..10)}) -> sender v_src @index value v_index { + setverdict(fail, "The any from getcall operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + testcase TC_Sem_220302_getcall_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 100 }, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_009(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0b13cff981e59dc6c8ca9348c1e415a6740a7649 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_010.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from done assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +// When checking the port array for matching calls, the port indices to be checked are iterated +// from lowest to highest. +module Sem_220302_getcall_operation_010 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index, v_parValue; + alt + { + [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> param (v_parValue := p_par) @index value v_index { + if(v_index == 1 and v_parValue == v_index + 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_Sem_220302_getcall_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 1 }, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72f92f8e95cb8458d5a42f936345de4512ea5bd2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_011.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify that any from getcall index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_220302_getcall_operation_011 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + var integer v_index[2], v_parValue; + var GeneralComp v_src; + alt + { + [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> param (v_parValue := p_par) sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); } + } + } + + testcase TC_Sem_220302_getcall_operation_011() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].call(S:{ p_par := i + 1 }, nowait); } + } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d8d4227821aae4bd4641cef8c3c08775c49035b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_012.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify any from getcall index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction k +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the getcall operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// getcall operation. +module Sem_220302_getcall_operation_012 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + var @lazy integer v_index; + alt + { + [] any from p.getcall -> @index value v_index { + if(v_index == 1){ // no getcall call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall didn't match for some reason"); } + } + } + testcase TC_Sem_220302_getcall_operation_012() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 100 }, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1643aadf3bb3b26a033eefcabc865bea00c78091 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_013.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.2, Verify any from getcall index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction k +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the getcall operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// getcall operation. +module Sem_220302_getcall_operation_013 { + + signature S(integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + var @fuzzy integer v_index; + alt + { + [] any from p.getcall -> @index value v_index { + if(v_index == 1){ // no getcall call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getcall didn't match for some reason"); } + } + } + testcase TC_Sem_220302_getcall_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 100 }, nowait); } + } + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_220302_getcall_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc0a516f97579902119764b2128235caaadcac27 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_014.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, @decoded redirect assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a call, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220302_getcall_operation_014 { + signature S(bitstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_res; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_014() runs on GeneralComp system GeneralComp { + var charstring v_src := "abc"; + var bitstring v_bs := encvalue(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_bs }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b479e805805a737b7aae27efb6ba969bc5d3a29 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_015.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, @decoded redirect assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a call, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220302_getcall_operation_015 { + signature S(hexstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_res; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_015() runs on GeneralComp system GeneralComp { + var charstring v_src := "abc"; + var hexstring v_hs := bit2hex(encvalue(v_src)); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_hs }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cba5dd5a669b2ac73e00b51f94f12af041cbb192 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_016.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, @decoded redirect assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a call, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220302_getcall_operation_016 { + signature S(octetstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_res; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_016() runs on GeneralComp system GeneralComp { + var charstring v_src := "abc"; + var octetstring v_os := bit2oct(encvalue(v_src)); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_os }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea38fbc3a0887451f5ef732516babe0ebf606845 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_017.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, @decoded redirect assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a call, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220302_getcall_operation_017 { + signature S(charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_017() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ea056396841e899c145be9b001e21aed66d07fe --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_018.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.2, @decoded redirect assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a call, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220302_getcall_operation_018 { + signature S(universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { encode "32bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_018() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e77296972ad762131a98d70676a7b112cb8d145 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_019.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.2, @decoded redirect assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220302_getcall_operation_019 { + signature S(universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_res with { variant "32 bit" }; + alt { + [] p.getcall(S:?) -> param (v_res := @decoded("UTF-16LE") p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getcall { setverdict(fail); } + } + } + + testcase TC_Sem_220302_getcall_operation_019() runs on GeneralComp system GeneralComp { + var integer v_src := 1953719668 with { variant "32 bit" }; + var universal charstring v_str := encvalue_unichar(v_src, "UTF-16LE"); + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := v_str }, nowait); + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220302_getcall_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_020.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14acef1844cc78885c47b0cca6373a19e8328ac1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_020.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.2, getcall with a from clause (single item) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getcall operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220302_getcall_operation_020 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.call(S:{}, nowait); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220302_getcall_operation_020() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_receiveCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getcall(S:?) from v_ptcs[0] { setverdict(pass); } // expected 1 from match + [] p.getcall(S:?) { v_receiveCounter := v_receiveCounter + 1; } // expected 2 other received exceptions + } + } + if (v_receiveCounter != c_ptcCount - 1) { setverdict(fail); } + } + + control { + execute(TC_Sem_220302_getcall_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_021.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41559a1977bbdb9b95bda29fd1e9412638fb0657 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_021.ttcn @@ -0,0 +1,54 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.2, getcall with a from clause (multiple items) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getcall operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220302_getcall_operation_021 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.call(S:{}, nowait); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220302_getcall_operation_021() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_fromCounter := 0, v_noFromCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getcall(S:?) from (v_ptcs[0], v_ptcs[1]) { v_fromCounter := v_fromCounter + 1; } + [] p.getcall(S:?) { v_noFromCounter := v_noFromCounter + 1; } + } + } + if (v_fromCounter == 2 and v_noFromCounter == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220302_getcall_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_022.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c9b4e23b787c32d4ab9bb6972c57e039459de5f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220302_getcall_operation/Sem_220302_getcall_operation_022.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.2, getcall with a from clause (any component) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getcall operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220302_getcall_operation_022 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.call(S:{}, nowait); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220302_getcall_operation_022() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getcall(S:?) from any component { setverdict(pass); } + [] p.getcall(S:?) { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220302_getcall_operation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9bcd2310555e0e993fdb835ff55b257b8a384ca --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_001.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:22.3.3, Ensure that reply operations are only used on procedure based ports + ** @verdict pass reject + ***************************************************/ + +module NegSem_220303_ReplyOperation_001 { + + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_220303_ReplyOperation_001() runs on GeneralComp { + + messagePort.send(2); + + alt { + [] messagePort.receive(2) { + messagePort.reply(3); //cannot use reply on a message based port + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_220303_ReplyOperation_001()); +} + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65d64c3e5bf273c38f63baf0392959b1dc967d3a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.3, null component in the to clause of the reply operation + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220303_ReplyOperation_002 { + + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var GeneralComp v_compRef := null; + p.getcall(S:?); + p.reply(S:{}) to v_compRef; + } + + testcase TC_NegSem_220303_ReplyOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, 1.0) { + [] p.getreply(S:{}) { } + [] p.catch(timeout) { } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_002(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab7b4055065aa429da1c1bac96943c3b00b06e23 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_003.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.3, null component in the multicast list of the to clause of the reply operation + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220303_ReplyOperation_003 { + + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var GeneralComp v_compRef := null; + p.getcall(S:?); + p.reply(S:{}) to (mtc, v_compRef); + } + + testcase TC_NegSem_220303_ReplyOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, 1.0) { + [] p.getreply(S:{}) { } + [] p.catch(timeout) { } + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_003(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..253078fe38c84a6b4a71952113e295b4d559f7b8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_004.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that reply operation cannot be used on a message port + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// a) A reply operation shall only be used at a procedure-based port. + +module NegSem_220303_ReplyOperation_004 { + + signature S() return integer; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_220303_ReplyOperation_004() runs on GeneralComp { + p.reply(S:{} value 1); + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_004(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b70c4fd79fc1453bf8a50ff5aacd773438f3c06 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_005.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that signature not listed in the port definition cannot be used in the reply operation + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220303_ReplyOperation_005 { + + signature S(); + signature SNotListed(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + p.getcall; + p.reply(SNotListed:{}); + } + + testcase TC_NegSem_220303_ReplyOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_005(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c47b0a6d57d7ef02d2844ca058e63bbee4660e1a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_006.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that matching symbols cannot be used in out signature parameters in reply operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// b) All out and inout parameters of the signature shall have a specific value i.e. +// the use of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220303_ReplyOperation_006 { + + type record R { + integer field1, + integer field2 + } + + signature S(out R par1); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var template R v_rec := { field1 := 0, field2 := ? } + p.getcall(S:?); + p.reply(S:{par1 := v_rec}); + } + + testcase TC_NegSem_220303_ReplyOperation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{-}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_006(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..afc41b6047cd9c720b3d889bcb52c38ca3a5b78f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_007.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that matching symbols cannot be used in inout signature parameters in reply operations + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// b) All out and inout parameters of the signature shall have a specific value i.e. +// the use of matching mechanisms such as AnyValue is not allowed. + +module NegSem_220303_ReplyOperation_007 { + + type record R { + integer field1, + integer field2 + } + + signature S(inout R par1); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var template R v_rec := { field1 := 0, field2 := ? } + p.getcall(S:?); + p.reply(S:{par1 := v_rec}); + } + + testcase TC_NegSem_220303_ReplyOperation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{par1 := {field1 := 0, field2 := 5} }, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_007(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38ef26cb378f8892f4a347b0d30d872988c4e672 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_008.ttcn @@ -0,0 +1,78 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that error is issued for a missing to clause in a reply operation in case of one-to-many connections + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// c) A to clause shall be present in case of one-to-many connections. + +module NegSem_220303_ReplyOperation_008 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_ClientQuery() runs on GeneralComp { + + p.call(S:{}, 1.0) { + + [] p.getreply(S:{}) { + } + [] p.catch (timeout) { + } + } + setverdict(pass); + } + + function f_ServerResponses() runs on GeneralComp { + var GeneralComp v_client1 := null, v_client2 := null; + + alt { + [v_client1 == null] p.getcall(S:{}) -> sender v_client1 { + if (v_client2 == null) { repeat; } + } + [v_client2 == null] p.getcall(S:{}) -> sender v_client2 { + if (v_client1 == null) { repeat; } + } + } + p.reply(S:{}); // to clause missing, but there are 2 clients! + setverdict(pass); + } + + testcase TC_NegSem_220303_ReplyOperation_008() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:p, client:p); + connect(server:p, client2:p); + + server.start(f_ServerResponses()); + + client2.start(f_ClientQuery()); + client.start(f_ClientQuery()); + + interleave { + [] client.done {} + [] client2.done {} + } + server.stop; + + alt { + [] all component.done {} + } + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbc3b03fd5815ca9e79021ac64f146589661f65a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_009.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that values that are not addresses or components cannot be used in the to clause of the reply operation + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// d) All AddressRef items in the to clause shall be of type address, component or of the address +// type bound to the port type (see clause 6.2.9) of the port instance referenced in the reply +// operation. + +module NegSem_220303_ReplyOperation_009 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_addr := 10; + p.getcall(S:?); + p.reply(S:{}) to v_addr; + } + + testcase TC_NegSem_220303_ReplyOperation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_009(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc94cce193b716e785b645057033c2d9cc7d1027 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/NegSem_220303_ReplyOperation_010.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that reply operation on a disconnected port causes an error + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// f) Applying a reply operation to an unmapped or disconnected port shall cause a test +// case error. + +module NegSem_220303_ReplyOperation_010 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + p.getcall(S:?); + disconnect(self:p); + p.reply(S:{}); + } + + testcase TC_NegSem_220303_ReplyOperation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_NegSem_220303_ReplyOperation_010(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c06203ba69cea9f6d7c8a501f963d10f5c4c9202 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_001.ttcn @@ -0,0 +1,116 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.3, Ensure that the IUT correctly handles reply to multiple clients on the same server + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220303_ReplyOperation_001 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220303_ReplyOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + + template p_Sem_220303_ReplyOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220303_ReplyOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220303_ReplyOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220303_ReplyOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_220303_ReplyOperation_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220303_ReplyOperation_002:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail, "Component did not receive a response"); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + var GeneralComp v_client1 := null, v_client2 := null; + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220303_ReplyOperation_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + t_timeout.start; + + alt { + [v_client1 == null] PCO.getcall(p_Sem_220303_ReplyOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_client1 { + if (v_client2 == null) { repeat; } + } + [v_client2 == null] PCO.getcall(p_Sem_220303_ReplyOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_client2 { + if (v_client1 == null) { repeat; } + } + [] t_timeout.timeout { + setverdict(fail); + } + } + PCO.reply(p_Sem_220303_ReplyOperation_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to all component; //sent to both connected clients + + } + + testcase TC_Sem_220303_ReplyOperation_001() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server:PCO, client2:PCO); + + server.start(f_ServerResponses()); + + client2.start(f_ClientQuery()); + client.start(f_ClientQuery()); + + interleave { + [] client.done {} + [] client2.done {} + } + server.stop; + + alt { + [] all component.done {} + } + } + + control{ + execute(TC_Sem_220303_ReplyOperation_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8acaa0b7f0c1272f5c6f3ac6ccdd3d43b38c420a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_002.ttcn @@ -0,0 +1,118 @@ +/***************************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.3, Ensure that the IUT correctly handles reply to multiple clients on the same server + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_220303_ReplyOperation_002 { + + /** + * @desc testing of inline return template for remote procedure call + * @param p_par1 only input parameter + * @param p_par2 must have value 4 at return + * @param p_par3 must have value 5 at return + * @return must return value 1 + */ + signature p_Sem_220303_ReplyOperation_002(in integer p_par1, out integer p_par2, inout integer p_par3) return integer; + + + template p_Sem_220303_ReplyOperation_002 s_returnTemplate := { + p_par1 := -, + p_par2 := 4, + p_par3 := 5 + } + + template p_Sem_220303_ReplyOperation_002 s_wrongTemplate := { + p_par1 := -, + p_par2 := 2, + p_par3 := 3 + } + + template p_Sem_220303_ReplyOperation_002 s_callTemplate := { + p_par1 := 1, + p_par2 := -, + p_par3 := 3 + } + + type port remotePort procedure { + inout p_Sem_220303_ReplyOperation_002; + } + + type component GeneralComp { + port remotePort PCO; + } + + function f_ClientQuery() runs on GeneralComp { + + PCO.call(p_Sem_220303_ReplyOperation_002:s_callTemplate, 5.0) { + + [] PCO.getreply(p_Sem_220303_ReplyOperation_002:s_returnTemplate value 1) { + setverdict(pass); + } + [] PCO.catch (timeout) { + setverdict(fail, "Component did not receive a response"); + } + } + } + + function f_ServerResponses() runs on GeneralComp { + var GeneralComp v_client1 := null, v_client2 := null; + var integer v_par1; + var integer v_par3; + timer t_timeout:=30.0; + + template p_Sem_220303_ReplyOperation_002 s_acceptTemplate := { + p_par1 := ?, + p_par2 := ?, + p_par3 := ? + }; + + + t_timeout.start; + + alt { + [v_client1 == null] PCO.getcall(p_Sem_220303_ReplyOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_client1 { + if (v_client2 == null) { repeat; } + } + [v_client2 == null] PCO.getcall(p_Sem_220303_ReplyOperation_002:s_acceptTemplate) -> param(v_par1, - , v_par3) sender v_client2 { + if (v_client1 == null) { repeat; } + } + [] t_timeout.timeout { + setverdict(fail); + } + } + PCO.reply(p_Sem_220303_ReplyOperation_002:{p_par1 := -, p_par2 := v_par1+v_par3, p_par3 := v_par1+v_par3+1} value v_par1) to (v_client1, v_client2); //sent to both connected clients + + } + + + testcase TC_Sem_220303_ReplyOperation_002() runs on GeneralComp system GeneralComp { + var GeneralComp server := GeneralComp.create("RemoteProcedure Service"); + var GeneralComp client := GeneralComp.create("RemoteProcedure Client"); + var GeneralComp client2 := GeneralComp.create("RemoteProcedure Client"); + // map the PTCs to the system port + connect(server:PCO, client:PCO); + connect(server:PCO, client2:PCO); + + server.start(f_ServerResponses()); + + client2.start(f_ClientQuery()); + client.start(f_ClientQuery()); + + interleave { + [] client.done {} + [] client2.done {} + } + server.stop; + + alt { + [] all component.done {} + } + } + + control{ + execute(TC_Sem_220303_ReplyOperation_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..588119c3a482b5fde8baddd1fc0908814ea34923 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_003.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that functionality of a simple reply operation (implicit unicast, no return value) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The value part of the reply operation consists of a signature reference with an associated +// actual parameter list and (optional) return value. The signature may either be defined in +// the form of a signature template or it may be defined in-line. + +// In case of one-to-one connections, the to clause may be omitted, because the receiving entity +// is uniquely identified by the system structure. + +module Sem_220303_ReplyOperation_003 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_Sem_220303_ReplyOperation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_Sem_220303_ReplyOperation_003(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2edd18f411fc9c8d5148d1f2477904803f3ea6e2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_004.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that functionality of a simple reply operation (explicit unicast, return value) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// The value part of the reply operation consists of a signature reference with an associated +// actual parameter list and (optional) return value. The signature may either be defined in +// the form of a signature template or it may be defined in-line. + +// Responses to one or more call operations may be sent to one, several or all peer entities +// connected to the addressed port. This can be specified in the same manner as described in +// clause 22.2.1. This means, the argument of the to clause of a reply operation is for unicast +// responses the address of one receiving entity, for multicast responses a list of addresses +// of a set of receivers and for broadcast responses the all component keywords. + +module Sem_220303_ReplyOperation_004 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var GeneralComp v_sender; + p.getcall(S:?) -> sender v_sender; + p.reply(S:{} value 2) to v_sender; + } + + testcase TC_Sem_220303_ReplyOperation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_Sem_220303_ReplyOperation_004(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f742c76f8d48ba038e9a0209d8f72862e0d9051a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220303_reply_operation/Sem_220303_ReplyOperation_005.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.3, verify that in signature parameters of reply operations can contain matching symbols + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// b) All out and inout parameters of the signature shall have a specific value i.e. +// the use of matching mechanisms such as AnyValue is not allowed. + +module Sem_220303_ReplyOperation_005 { + + type record R { + integer field1, + integer field2 + } + + signature S(in R par1); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var template R v_rec := { field1 := 0, field2 := ? } + p.getcall(S:?); + p.reply(S:{par1 := v_rec}); + } + + testcase TC_Sem_220303_ReplyOperation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ par1 := { field1 := 0, field2 := 10 } }, nowait); + alt { + [] p.getreply {} + [] v_ptc.done {} + } + setverdict(pass); + } + + control{ + execute(TC_Sem_220303_ReplyOperation_005(), 5.0); + } + +} diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1c2c72a1c61455a766afdf870c280b9c4e7bfaf --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when any from getreply is applied to single port + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction e +// The PortArrayRef shall be a reference to a port array variable identifier. +module NegSem_220304_getreply_operation_001 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220304_getreply_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply { setverdict(pass); } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b145dbc493aa23cc148b33694269cb83d83b992f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_002.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when any from getreply is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220304_getreply_operation_002 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{}) }; + } + } + + testcase TC_NegSem_220304_getreply_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index[1]; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:?) -> @index value v_index { + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7aa5ce8ec9f16edffd8c2b5b104b55b8ab4f6b7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_003.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when any from getreply is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220304_getreply_operation_003 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{}) }; + } + } + + testcase TC_NegSem_220304_getreply_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var float v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:?) -> @index value v_index { + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8ca6a60522e6e5dff7bb66b45f6ff1d7f09ac7e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_004.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220304_getreply_operation_004 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall(S:?); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].reply(S:{}); } + } + } + } + + + testcase TC_NegSem_220304_getreply_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index[1]; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{}, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:{}) -> sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } } + + control { + execute(TC_NegSem_220304_getreply_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..96f4017569baa711b1422b343d76e150e20f56e2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_005.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220304_getreply_operation_005 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall(S:?); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].reply(S:{}); } + } + } + } + + testcase TC_NegSem_220304_getreply_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{}, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:{}) -> @index value v_index { + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..727c05b3ac2337ba3c91a4f049f24428656fca5a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_006.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, null component in the from clause of the getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220304_getreply_operation_006 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.reply(S:{}); + } + + testcase TC_NegSem_220304_getreply_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.getreply(S:{}) from v_compRef {} // error expected + [] p.getreply(S:{}) {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec6b39d8253f84ec4fe71323c9caa8c8b7d6f5f7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_007.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, null component in the multicast list of the from clause of the getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220304_getreply_operation_007 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.reply(S:{}); + } + + testcase TC_NegSem_220304_getreply_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.getreply(S:{}) from (mtc, v_compRef) {} // error expected + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7ca1a8c59af920e5bc3a26f536150c37060f899 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_008.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, applying @decoded to a forbidden parameter field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220304_getreply_operation_008 { + type record of integer RoI (0..255); + + signature S(out RoI p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{ p_par := { 0, 0, 0, 0 } }); + } + + testcase TC_NegSem_220304_getreply_operation_008() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := { 0, 0, 0, 0 } }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getreply { setverdict(fail); } + + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fae32d02d2b78fb0cd9b8b23405b88e4330a3964 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_009.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, decoding error in @decoded redirect parameter assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Failure of this decoding shall cause a test case error. + +module NegSem_220304_getreply_operation_009 { + signature S(out charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src) & "abcdefgij"; + p.getcall(S:?); + p.reply(S:{ p_par := v_str }); + } + + testcase TC_NegSem_220304_getreply_operation_009() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..567ca9ed97f991ec494a75e2f029b8a5dcdf8bba --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_010.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, invalid format value in @decoded redirect parameter assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220304_getreply_operation_010 { + signature S(out universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_str }); + } + + testcase TC_NegSem_220304_getreply_operation_010() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded("proprietary") p_par) { + setverdict(pass); + } + [] p.getreply { setverdict(pass); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f47c61e3028f7e92934ebdc64aa5dc52528f43f7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_011.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, value of wrong type in @decoded redirect parameter assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220304_getreply_operation_011 { + signature S(out universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_str }); + } + + testcase TC_NegSem_220304_getreply_operation_011() runs on GeneralComp system GeneralComp { + var integer v_res, v_enc := 32 with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded(v_enc) p_par) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220304_getreply_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49907961bb33608e3e795fc6d039eedc9ed95036 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_012.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, encoding parameter of @decoded redirect parameter assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220202_ReceiveOperation_012 { + signature S(out octetstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.getcall(S:?); + p.reply(S:{ p_par := v_os }); + } + + testcase TC_NegSem_220304_getreply_operation_012() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded("UTF-8") p_par) { + setverdict(pass); + } + [] p.getreply { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220304_getreply_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d92dfb89fb89b172f475e12919354b3998b2f82 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_013.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, incompatible from and sender clause in getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the getreply operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_220304_getreply_operation_013 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220304_getreply_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.getreply(S:{}) from AltComp:? -> sender v_compRef { } // error expected + [] p.getreply(S:{}) { } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2570ac4260f0b6dde5d715a004e10ffd0ca9adf6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_014.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, incompatible decmatch and @decoded parameter redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded parameters (by using the @decoded modifier) +// in cases where the value or template to be matched uses the MatchDecodedContent +// (decmatch) matching for the parameter to be stored, the type of the template in +// the MatchDecodedContent matching shall be type-compatible to the type of the +// variable the decoded field is stored into. + +module NegSem_220304_getreply_operation_014 { + signature S(out bitstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type record Wrapped { + integer num + } + + function f_server() runs on GeneralComp { + var integer v_src := 5; + var bitstring v_bs := encvalue(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_bs }); + } + + testcase TC_NegSem_220304_getreply_operation_014() runs on GeneralComp system GeneralComp { + var Wrapped v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:{ p_par := decmatch integer:? }) -> param (v_res := @decoded p_par) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d5a232650caf94de69d96beab046ba27f3cc736 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_015.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, applying @decoded to a forbidden parameter field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220304_getreply_operation_015 { + type record R { + integer id, + record of integer payload(0..255) + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var R v_rec := { id := 6, payload := { 0, 0, 0, 0 }} + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_015() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.getreply { setverdict(fail); } + + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2601a6c4c33a2922cfb05afcc5e22d669ad1f24f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_016.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, decoding error in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Failure of this decoding shall cause a test case error. + +module NegSem_220304_getreply_operation_016 { + type record R { + integer id, + charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 4, payload := encvalue_unichar(v_src) & "abcdefgij" }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_016() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f3307724c7d79a18ae8c87fa3f98956221b57eb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_017.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, invalid format value in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220304_getreply_operation_017 { + type record R { + integer id, + universal charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_017() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded("proprietary") payload) { + setverdict(pass); + } + [] p.getreply { setverdict(pass); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55428fb28579877870bd68ffe34d57d96821b3f9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_018.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, value of wrong type in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220304_getreply_operation_018 { + type record R { + integer id, + universal charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_018() runs on GeneralComp system GeneralComp { + var integer v_res, v_enc := 32 with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded(v_enc) payload) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220304_getreply_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6b1d0728b143c6ec65eff0c547445629bf11145 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_019.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, encoding parameter of @decoded redirect value assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220202_ReceiveOperation_019 { + type record R { + integer id, + octetstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 3, payload := bit2oct(encvalue(v_src)) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_019() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded("UTF-8") payload) { + setverdict(pass); + } + [] p.getreply { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220304_getreply_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_020.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9031d9911e94d1e88fa351a6f89416930ed82442 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_020.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, incompatible decmatch and @decoded value redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded parameters (by using the @decoded modifier) +// in cases where the value or template to be matched uses the MatchDecodedContent +// (decmatch) matching for the parameter to be stored, the type of the template in +// the MatchDecodedContent matching shall be type-compatible to the type of the +// variable the decoded field is stored into. + +module NegSem_220304_getreply_operation_020 { + type record R { + integer id, + bitstring payload + } + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type record Wrapped { + integer num + } + + function f_server() runs on GeneralComp { + var integer v_src := 5; + var R v_rec := { id := 1, payload := encvalue(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220304_getreply_operation_020() runs on GeneralComp system GeneralComp { + var Wrapped v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:{} value R:{ id := ?, payload := decmatch integer:? }) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220304_getreply_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_021.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6481a7f9c66b8e34ce7bb5935eec7ff6420aa1f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_021.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:22.3.4, incompatible template in the from clause of the getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// f) All AddressRef items in the from clause and all VariableRef items in the sender clause +// shall be of type address, component or of the address type bound to the port type (see +// section 6.2.9) of the port instance referenced in the getcall operation. + +module NegSem_220304_getreply_operation_021 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall(S:{}); + p.reply(S:{} value 1); + } + + testcase TC_NegSem_220304_getreply_operation_021() runs on GeneralComp system GeneralComp { + var charstring v_addr := "addr"; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.getreply(S:?) from v_addr {} // error expected + [] p.getreply {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_022.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4181b4db2b9921322964e627597047080298d8d8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSem_220304_getreply_operation_022.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.4, trying to store an incompatible component value in the sender clause of a getreply operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// j) If the operation contains a sender clause but no from clause, the sender shall be type +// compatible with the type of the variable or parameter referenced in the sender clause. + +module NegSem_220304_getreply_operation_022 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSem_220304_getreply_operation_022() runs on GeneralComp system GeneralComp { + var AltComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.getreply(S:{}) -> sender v_compRef { } // error expected + [] p.getreply(S:{}) { } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220304_getreply_operation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12f5605b76531cbce75fc038d0f82d8049c1cb17 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when using index redirection in port.getreply operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220304_getreply_operation_001 { + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSyn_220304_getreply_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] p.getreply -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSyn_220304_getreply_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f6dfdf41c8586c5f4f42e2b6b85e6fedae98dff --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/NegSyn_220304_getreply_operation_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that error occurs when using index redirection in any port.getreply operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction f +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220304_getreply_operation_002 { + + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.reply(S:{}); + } + + testcase TC_NegSyn_220304_getreply_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any port.getreply -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSyn_220304_getreply_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ab95e5d0df96b3c42f89b3cad44156e98094a75 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply is not triggered if there hasn't been any reply + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To getreply on any port from a specific port array, use the any from PortArrayRef syntax where +// PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220304_getreply_operation_001 { + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + testcase TC_Sem_220304_getreply_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + } + alt + { + [] any from p.getreply { setverdict(fail, "The any from getreply operation produced incorrect match"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b53409902607a97fd5bf353df6bc10299f1d8f5d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_002.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply matches if at least one port contains enqueued reply + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To getreply on any port from a specific port array, use the any from PortArrayRef syntax where +// PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220304_getreply_operation_002 { + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{}) }; + } + } + + testcase TC_Sem_220304_getreply_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply { setverdict(pass); } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..573ea75618d5fb8719ac8a5dd32825f34a6b04fd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_003.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply doesn't assign index when there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220304_getreply_operation_003 { + + signature S(out integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{ p_par := i + 100 }) }; + } + } + + testcase TC_Sem_220304_getreply_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{ p_par := - }, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:{p_par := (1..10)}) -> @index value v_index { + setverdict(fail, "The any from getreply operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_220304_getreply_operation_003(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d50a024ed3a7bc6d8eba89729f95930e18ffcc64 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_004.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply doesn't change index variable when no there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220304_getreply_operation_004 { + + signature S(out integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{ p_par := i + 100 }) }; + } + } + + testcase TC_Sem_220304_getreply_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index := 99; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{ p_par := - }, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:{p_par := (1..10)}) -> @index value v_index { + setverdict(fail, "The any from getreply operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_220304_getreply_operation_004(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a01dd6ba42d22c78d55de09fd6da737ffa7fc65 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_005.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from done assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +// When checking the port array for matching replies, the port indices to be checked are iterated +// from lowest to highest. +module Sem_220304_getreply_operation_005 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{} value i + 1) }; + } + } + + testcase TC_Sem_220304_getreply_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index, v_res; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:? value (0..c_portCount)) -> value v_res @index value v_index { + if(v_index == 1 and v_res == v_index + 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59f6f27202c625f8891f28c09b77a21a7f12fbf1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_006.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify that any from getreply index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction h: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_220304_getreply_operation_006 { + + signature S(out integer p_par); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall; + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].reply(S:{ p_par := i + 1 }); } + } + } + } + + testcase TC_Sem_220304_getreply_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index[2], v_parValue; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{ p_par := i + 1 }, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:{p_par := (0..c_portCount)}) -> param (v_parValue := p_par) sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08b06d6bc3ba6c675186520a8ed3d9b970f55c8e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_007.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify any from getreply index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the getreply operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// getreply operation. +module Sem_220304_getreply_operation_007 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{}) }; + } + } + testcase TC_Sem_220304_getreply_operation_007() runs on GeneralComp system GeneralComp { + var @lazy integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:?) -> @index value v_index { + if(v_index == 1){ // no getreply call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b5a0eb0da6a0364f91353767a72202691f17bab7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_008.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.4, Verify any from getreply index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the getreply operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// getreply operation. +module Sem_220304_getreply_operation_008 { + + signature S(); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].reply(S:{}) }; + } + } + testcase TC_Sem_220304_getreply_operation_008() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.getreply(S:?) -> @index value v_index { + if(v_index == 1){ // no getreply call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from getreply operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..017b45c735ac4f3a565558a9c3d7325610d21b99 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_009.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_009 { + signature S(out bitstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var bitstring v_bs := encvalue(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_bs }); + } + + testcase TC_Sem_220304_getreply_operation_009() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e44204ceeca7906a032345750d2799fea10ae6d6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_010.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_010 { + signature S(out hexstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var hexstring v_hs := bit2hex(encvalue(v_src)); + p.getcall(S:?); + p.reply(S:{ p_par := v_hs }); + } + + testcase TC_Sem_220304_getreply_operation_010() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7471180270c0aec347c6113993d827bbee67c542 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_011.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_011 { + signature S(out octetstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var octetstring v_os := bit2oct(encvalue(v_src)); + p.getcall(S:?); + p.reply(S:{ p_par := v_os }); + } + + testcase TC_Sem_220304_getreply_operation_011() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + + } + } + + control { + execute(TC_Sem_220304_getreply_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b5d7ae6ebcc6ec9c67fce60f52fe3aa54298b20 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_012.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_012 { + signature S(out charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var charstring v_str := encvalue_unichar(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_str }) + } + + testcase TC_Sem_220304_getreply_operation_012() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4093a6af5e9b12d47a99fb1a0b6ea246ec9362b0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_013.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_013 { + signature S(out universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var universal charstring v_str := encvalue_unichar(v_src); + p.getcall(S:?); + p.reply(S:{ p_par := v_str }); + } + + testcase TC_Sem_220304_getreply_operation_013() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220304_getreply_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86ff6c190959185dac28af2f0b235fce21ead015 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_014.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, @decoded redirect parameter assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220304_getreply_operation_014 { + signature S(out universal charstring p_par); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { variant "32 bit" }; + var universal charstring v_str := encvalue_unichar(v_src, "UTF-16LE"); + p.getcall(S:?); + p.reply(S:{ p_par := v_str }); + } + + testcase TC_Sem_220304_getreply_operation_014() runs on GeneralComp system GeneralComp { + var integer v_res with { variant "32 bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ p_par := - }) { + [] p.getreply(S:?) -> param (v_res := @decoded("UTF-16LE") p_par) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + }; + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220304_getreply_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fae2ff270328aad7d37e8c0b697a64ba77e4bed0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_015.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect value assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_015 { + type record R { + integer id, + bitstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 1, payload := encvalue(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + log("dada"); + } + + testcase TC_Sem_220304_getreply_operation_015() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2583a257e2a1b900c33a1dd44aec9cb3d4ad3168 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_016.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect value assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_016 { + type record R { + integer id, + hexstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 2, payload := bit2hex(encvalue(v_src)) }; + p.getcall(S:?); + p.reply(S:{ } value v_rec); + } + + testcase TC_Sem_220304_getreply_operation_016() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ }) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf3fbfc0d98b72c7bfef608812b892045656c50a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_017.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect value assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_017 { + type record R { + integer id, + octetstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 3, payload := bit2oct(encvalue(v_src)) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_Sem_220304_getreply_operation_017() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + + } + } + + control { + execute(TC_Sem_220304_getreply_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_018.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69451cdbcc7b6bb517c2b112174ffcf8ec4a2d20 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_018.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect value assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_018 { + type record R { + integer id, + charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 4, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec) + } + + testcase TC_Sem_220304_getreply_operation_018() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_019.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8bfe73dd3f4ced949811c8ab7718283f20c98f0c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_019.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.4, @decoded redirect value assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of a reply, encoded parameters can be decoded +// prior to assignment using the @decoded modifier. In this case, the referenced +// parameter on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220304_getreply_operation_019 { + type record R { + integer id, + universal charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_Sem_220304_getreply_operation_019() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220304_getreply_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_020.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0657f669e04a0537ee78d4898837fe007913dc95 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_020.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.4, @decoded redirect value assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220304_getreply_operation_020 { + type record R { + integer id, + universal charstring payload + } + + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { variant "32 bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src, "UTF-16LE") }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_Sem_220304_getreply_operation_020() runs on GeneralComp system GeneralComp { + var integer v_res with { variant "32 bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:?) -> value (v_res := @decoded("UTF-16LE") payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.getreply { setverdict(fail); } + }; + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220304_getreply_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_021.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea71636c8e5896940cf5b345d64f925d8955d918 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_021.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.4, getreply with a from clause (single item) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getreply operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220304_getreply_operation_021 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall(S:{}); + p.reply(S:{} value 1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220304_getreply_operation_021() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_receiveCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getreply(S:?) from v_ptcs[0] { setverdict(pass); } // expected 1 from match + [] p.getreply(S:?) { v_receiveCounter := v_receiveCounter + 1; } // expected 2 other received exceptions + } + } + if (v_receiveCounter != c_ptcCount - 1) { setverdict(fail); } + } + + control { + execute(TC_Sem_220304_getreply_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_022.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..90e13f139e6372187498e6ae392e15bd147b2ee8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_022.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.4, getreply with a from clause (multiple items) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getreply operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220304_getreply_operation_022 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall(S:{}); + p.reply(S:{} value 1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220304_getreply_operation_022() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_fromCounter := 0, v_noFromCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getreply(S:?) from (v_ptcs[0], v_ptcs[1]) { v_fromCounter := v_fromCounter + 1; } + [] p.getreply(S:?) { v_noFromCounter := v_noFromCounter + 1; } + } + } + if (v_fromCounter == 2 and v_noFromCounter == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220304_getreply_operation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_023.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e08d3390623e7b0e8817d2e38406398fa17ea86 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220304_getreply_operation/Sem_220304_getreply_operation_023.ttcn @@ -0,0 +1,53 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.4, getreply with a from clause (any component) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A getreply operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220304_getreply_operation_023 { + + signature S() return integer; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall(S:{}); + p.reply(S:{} value 1); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220304_getreply_operation_023() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.getreply(S:?) from any component { setverdict(pass); } + [] p.getreply(S:?) { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220304_getreply_operation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18dec5ee1b38166c3b686ff63b67e637dcc8a2c7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.5, raised exception type not in the list of available exceptions + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Exceptions are specified as types. Therefore the exception value may either be derived +// from a template conforming to the template(value) restriction or be the value resulting +// from an expression (which of course can be an explicit value). The optional type field in +// the value specification to the raise operation shall be used in cases where it is necessary +// to avoid any ambiguity of the type of the value being sent. + +module NegSem_220305_raise_operation_001 { + signature S() exception(charstring, octetstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..830e91bc3f99a7ca60b3ab1f4c1bbd95437d4af7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_002.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.5, exception raised for a signature with no exception list + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Exceptions are specified as types. Therefore the exception value may either be derived +// from a template conforming to the template(value) restriction or be the value resulting +// from an expression (which of course can be an explicit value). The optional type field in +// the value specification to the raise operation shall be used in cases where it is necessary +// to avoid any ambiguity of the type of the value being sent. + +module NegSem_220305_raise_operation_002 { + signature S(); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8fefd165d155dfca6d262d3b665fecb88d3c4af --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_003.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.5, raised exception type is ambiguous + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Exceptions are specified as types. Therefore the exception value may either be derived +// from a template conforming to the template(value) restriction or be the value resulting +// from an expression (which of course can be an explicit value). The optional type field in +// the value specification to the raise operation shall be used in cases where it is necessary +// to avoid any ambiguity of the type of the value being sent. + +module NegSem_220305_raise_operation_003 { + type integer MyInt1 (1..10); + type integer MyInt2 (1..20); + + signature S() exception(MyInt1, MyInt2); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81ad0ba23424af64df4bd58bdd275820f26ef7ae --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_004.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, missing to clause in case of 1 to n connection + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// In case of one-to-one connections, the to clause may be omitted, because the receiving +// entity is uniquely identified by the system structure. + +module NegSem_220305_raise_operation_004 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + p.call(S:{}) { + [] p.catch(S, p_expected) { setverdict(pass); } + [] p.catch { setverdict(fail); } + } + } + + testcase TC_NegSem_220305_raise_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, v_ptc2 := GeneralComp.create; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f(1)); + v_ptc2.start(f(1)); + p.getcall(S:?); + p.getcall(S:?); // call from both components expected + p.raise(S, 1); // missing to clause: error expected + all component.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220305_raise_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce2c01438921d62a4c3bd59a9dc5483404c2c998 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_005.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, exception on a message port + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// An exception shall only be raised at a procedure-based port. An exception is a reaction +// to an accepted procedure call the result of which leads to an exceptional event. + +module NegSem_220305_raise_operation_005 { + signature S() exception(integer); + + type port PSig procedure { + inout S; + } + + type port PMsg message { + inout integer; + } + + type component GeneralComp + { + port PSig p1; + port PMsg p2; + } + + function f() runs on GeneralComp + { + p1.getcall(S:?); + p2.raise(S, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + v_ptc.start(f()); + p1.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee06dc6052049ce88bbc97c05f7365b9b3b5b657 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_006.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, exception procedure signature not in the port list + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// The type definition of the port shall include in its list of accepted procedure calls the +// name of the procedure to which the exception belongs. + +module NegSem_220305_raise_operation_006 { + signature S1() exception(integer); + signature S2() exception(integer); + + type port P procedure { + inout S1; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S1:?); + p.raise(S2, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S1:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..09cb4d15a7fc9a6b226a1da47c06261f0f8d81f1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_007.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.5, value of incorrect type in the to clause of the raise operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// All AddressRef items in the to clause shall be of type address, component or of the +// address type bound to the port type (see clause 6.2.9) of the port instance referenced +// in the raise operation. + +module NegSem_220305_raise_operation_007 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + const charstring c_ptcName := "PTC"; + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 1) to c_ptcName; + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create(c_ptcName); + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a86942a5de0439bb7c983997b06bb2d72bda941e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_008.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.5, null in the to clause of the raise operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220305_raise_operation_008 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + var GeneralComp v_compRef := null; + p.getcall(S:?); + p.raise(S, 1) to v_compRef; + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_008() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b68a362ba37a0f0402b1e37ad53deb2e42efa0de --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_009.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, raise operation on disconnected and unmapped ports + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Applying a raise operation to an unmapped or disconnected port shall cause a test case +// error. + +module NegSem_220305_raise_operation_009 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + disconnect(self:p); + p.raise(S, 1); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_009() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36a2dd4e16076a039401bebdc0789dd93374a825 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/NegSem_220305_raise_operation_010.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.5, exception template not conforming to template(value) restriction + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// f) The TemplateInstance shall conform to the template(value) restriction (see clause 15.8). + +module NegSem_220305_raise_operation_010 { + signature S() exception(charstring, octetstring); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall(S:?); + p.raise(S, charstring:?); + setverdict(pass); + } + + testcase TC_NegSem_220305_raise_operation_010() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_NegSem_220305_raise_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9ace5a23dd09fa986871647d53b50e8a6aa8315 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_001.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, simple raise operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// The value part of the raise operation consists of the signature reference followed by the +// exception value. + +module Sem_220305_raise_operation_001 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 1); + setverdict(pass); + } + + testcase TC_Sem_220305_raise_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}, nowait); // no processing of the exception to avoid possible errors in the catch operation + v_ptc.done; + } + + control { + execute(TC_Sem_220305_raise_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a40906f4a465739fbef6738f9c6b3b27bfd9894 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_002.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, unicast raise operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Exceptions to one or more call operations may be sent to one, several or all peer entities +// connected to the addressed port. This can be specified in the same manner as described in +// clause 22.2.1. This means, the argument of the to clause of a raise operation is for +// unicast exceptions the address of one receiving entity, for multicast exceptions a list of +// addresses of a set of receivers and for broadcast exceptions the all component keywords. + + +module Sem_220305_raise_operation_002 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + p.call(S:{}) { + [] p.catch(S, p_expected) { setverdict(pass); } + [] p.catch { setverdict(fail); } + } + } + + testcase TC_Sem_220305_raise_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, v_ptc2 := GeneralComp.create; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f(1)); + v_ptc2.start(f(2)); + p.getcall(S:?); + p.getcall(S:?); // call from both components expected + p.raise(S, 1) to v_ptc1; + p.raise(S, 2) to v_ptc2; + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220305_raise_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49da9cc24571471a9c1bc029fc3a35e196fb0297 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_003.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, broadcast raise operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Exceptions to one or more call operations may be sent to one, several or all peer entities +// connected to the addressed port. This can be specified in the same manner as described in +// clause 22.2.1. This means, the argument of the to clause of a raise operation is for +// unicast exceptions the address of one receiving entity, for multicast exceptions a list of +// addresses of a set of receivers and for broadcast exceptions the all component keywords. + +module Sem_220305_raise_operation_003 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.call(S:{}) { + []p.catch { setverdict(pass); } + } + } + + testcase TC_Sem_220305_raise_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc1 := GeneralComp.create, v_ptc2 := GeneralComp.create; + connect(self:p, v_ptc1:p); + connect(self:p, v_ptc2:p); + v_ptc1.start(f()); + v_ptc2.start(f()); + p.getcall(S:?); + p.getcall(S:?); // call from both components expected + p.raise(S, 1) to all component; + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220305_raise_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c14c8a4ff46408e92c85d01908ee1ec76ae319df --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220305_raise_operation/Sem_220305_raise_operation_004.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.5, multicast raise operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// Exceptions to one or more call operations may be sent to one, several or all peer entities +// connected to the addressed port. This can be specified in the same manner as described in +// clause 22.2.1. This means, the argument of the to clause of a raise operation is for +// unicast exceptions the address of one receiving entity, for multicast exceptions a list of +// addresses of a set of receivers and for broadcast exceptions the all component keywords. + + +module Sem_220305_raise_operation_004 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f(integer p_expected) runs on GeneralComp + { + p.call(S:{}) { + [] p.catch(S, p_expected) { setverdict(pass); } + [] p.catch { setverdict(fail); } + } + } + + const integer c_ptcCount := 4; + + testcase TC_Sem_220305_raise_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[4]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + if (i mod 2 == 0) { v_ptcs[i].start(f(1)); } + else { v_ptcs[i].start(f(2)); } + p.getcall(S:?); + } + p.raise(S, 1) to (v_ptcs[0], v_ptcs[2] ); + p.raise(S, 2) to (v_ptcs[1], v_ptcs[3] ); + all component.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220305_raise_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cd298df7cdf494495d3e6bda9fe2baf5e060d21 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when any from catch is applied to single port + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction g +// The PortArrayRef shall be a reference to a port array variable identifier. +module NegSem_220306_catch_operation_001 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 10); + } + + testcase TC_NegSem_220306_catch_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch { setverdict(pass); } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..89c87c287df7261e28e43346d181b09337b5d1df --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_002.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when any from catch is applied to 1D array and index target is array + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220306_catch_operation_002 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, 10) }; + } + } + + testcase TC_NegSem_220306_catch_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index[1]; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> @index value v_index { + if(v_index[0] == 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f0841f712be6f8f44286dfc8138ad37c6b408dc --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_003.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when any from catch is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction i +// If the index redirection is used for single-dimensional port arrays, the type +// of the integer variable shall allow storing the highest index of the respective array. +module NegSem_220306_catch_operation_003 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, 10) }; + } + } + + testcase TC_NegSem_220306_catch_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var float v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> @index value v_index { + if(v_index == 1.0){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..200b905445fa2a423bc6c623a043e043b6f2e4e6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_004.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch index redirection for multi-D arrays requires arrays of correct size + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220306_catch_operation_004 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall(S:?); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].raise(S, 10); } + } + } + } + + + testcase TC_NegSem_220306_catch_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index[1]; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{}, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } } + + control { + execute(TC_NegSem_220306_catch_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..312e0ef0b24c1c8863b812b9fb2dc8a852156fb4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_005.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch index redirection for multi-D arrays requires arrays + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module NegSem_220306_catch_operation_005 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall(S:?); + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].raise(S, 10); } + } + } + } + + testcase TC_NegSem_220306_catch_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{}, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> @index value v_index { + if(v_index == 1){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acb76c420821ca1d8f324f8c11eb53c0f2d2c04a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_006.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.6, null component in the from clause of the catch operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220306_catch_operation_006 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + testcase TC_NegSem_220306_catch_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.catch(S, charstring:?) from v_compRef {} // error expected + [] p.catch {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0524b2ed7adbf0b415b4ed9b51d10db9674861f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_007.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.6, null component in the multicast list of the from clause of the catch operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef in the to clause shall contain the special value null at the time +// of the operation. + +module NegSem_220306_catch_operation_007 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + testcase TC_NegSem_220306_catch_operation_007() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.catch(S, charstring:?) from (mtc, v_compRef) {} // error expected + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d37d905dd5fc6ccc34f8bd4387b6248fe3f3d7f4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_008.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, applying @decoded to a forbidden exception field + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module NegSem_220306_catch_operation_008 { + type record R { + integer id, + record of integer payload(0..255) + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var R v_rec := { id := 6, payload := { 0, 0, 0, 0 }} + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_NegSem_220306_catch_operation_008() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.catch { setverdict(pass); } + + } + } + + control { + execute(TC_NegSem_220306_catch_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a1dce180320450aa9799f9b03c881c9709ee28d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_009.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, decoding error in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Failure of this decoding shall cause a test case error. + +module NegSem_220306_catch_operation_009 { + type record R { + integer id, + charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 4, payload := encvalue_unichar(v_src) & "abcdefgij" }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220306_catch_operation_009() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.catch { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a85d6da38502e16ea1fdd148a660bc39c538184 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_010.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, invalid format value in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220306_catch_operation_010 { + type record R { + integer id, + universal charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_NegSem_220306_catch_operation_010() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded("proprietary") payload) { + setverdict(pass); + } + [] p.catch { setverdict(pass); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..906247108445055517b54cef0adcda97b713c74b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_011.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, value of wrong type in @decoded redirect value assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// Any other value shall cause an error. + +module NegSem_220306_catch_operation_011 { + type record R { + integer id, + universal charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_NegSem_220306_catch_operation_011() runs on GeneralComp system GeneralComp { + var integer v_res, v_enc := 32 with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded(v_enc) payload) { + setverdict (pass); + } + [] p.catch { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220306_catch_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66814eff192f7555b4f3edbc1cc0d1b8a3a6a242 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_012.ttcn @@ -0,0 +1,52 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, encoding parameter of @decoded redirect value assignment applied to incorrect type + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is not a universal charstring, the optional +// parameter shall not be present. + +module NegSem_220202_ReceiveOperation_012 { + type record R { + integer id, + octetstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 3, payload := bit2oct(encvalue(v_src)) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_NegSem_220306_catch_operation_012() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded("UTF-8") payload) { + setverdict(pass); + } + [] p.catch { setverdict(pass); } + } + + } + + control { + execute(TC_NegSem_220306_catch_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff9acbde414744327ec9c293892f01353a08c4db --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_013.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.6, incompatible from and sender clause in catch operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the catch operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_220306_catch_operation_013 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + p.getcall(S:?); + p.raise(S, "exc"); + } + + testcase TC_NegSem_220306_catch_operation_013() runs on GeneralComp system GeneralComp { + var GeneralComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.catch(S, charstring:?) from AltComp:? -> sender v_compRef { } // error expected + [] p.catch { } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4362eda8178f68b0df5b9536a8975893e4992a0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_014.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.6, incompatible decmatch and @decoded value redirect + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// When assigning implicitly decoded exception fields (by using the @decoded modifier) +// in cases where the value or template to be matched uses the MatchDecodedContent +// (decmatch) matching for the parameter to be stored, the type of the template in +// the MatchDecodedContent matching shall be type-compatible to the type of the +// variable the decoded field is stored into. + +module NegSem_220306_catch_operation_014 { + type record R { + integer id, + bitstring payload + } + signature S() return R; + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + type record Wrapped { + integer num + } + + function f_server() runs on GeneralComp { + var integer v_src := 5; + var R v_rec := { id := 1, payload := encvalue(v_src) }; + p.getcall(S:?); + p.reply(S:{} value v_rec); + } + + testcase TC_NegSem_220306_catch_operation_014() runs on GeneralComp system GeneralComp { + var Wrapped v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.getreply(S:{} value R:{ id := ?, payload := decmatch integer:? }) -> value (v_res := @decoded payload) { + setverdict (pass); + } + [] p.getreply { setverdict(pass); } + } + } + + control { + execute(TC_NegSem_220306_catch_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc350a236bdd5ac4b42631c96075d63183f3f029 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_015.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.2 + ** @purpose 1:22.3.6, incompatible template in the from clause of the catch operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// f) All AddressRef items in the from clause and all VariableRef items in the sender clause +// shall be of type address, component or of the address type bound to the port type (see +// clause 6.2.9) of the port instance referenced in the catch operation. + +module NegSem_220306_catch_operation_015 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + testcase TC_NegSem_220306_catch_operation_015() runs on GeneralComp system GeneralComp { + var charstring v_addr := "addr"; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.catch(S, charstring:?) from v_addr {} // error expected + [] p.catch {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d61b9dd07c43a975dfdaa2dbf526bad5111684d3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSem_220306_catch_operation_016.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.6, trying to store an incompatible component value in the sender clause of a catch operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// l) If the operation contains a sender clause but no from clause, the sender shall be type +// compatible with the type of the variable or parameter referenced in the sender clause. + +module NegSem_220306_catch_operation_016 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp { + var integer vc_int; + port P p; + } + + type component AltComp { + var charstring vc_str; + port P px; + } + + function f() runs on GeneralComp { + p.getcall(S:?); + p.raise(S, "exc"); + } + + testcase TC_NegSem_220306_catch_operation_016() runs on GeneralComp system GeneralComp { + var AltComp v_compRef := null; + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + v_ptc.start(f()); + p.call(S:{}) { + [] p.catch(S, charstring:?) -> sender v_compRef { } // error expected + [] p.catch { } + } + setverdict(pass); + } + + control { + execute(TC_NegSem_220306_catch_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e647494fd6c04c3d2005d0a1b0a8754fca29f65b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when using index redirection in port.catch operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220306_catch_operation_001 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 20); + } + + testcase TC_NegSyn_220306_catch_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] p.catch -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSyn_220306_catch_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9132345619ee97cd1e215aa806972644f6e99c60 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when using index redirection in any port.catch operation + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// Restriction h +// The index redirection shall only be used when the operation is used on an any from +// port array construct. +module NegSyn_220306_catch_operation_002 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:?); + p.raise(S, 10); + } + + testcase TC_NegSyn_220306_catch_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any port.catch -> @index value v_index { setverdict(pass); } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_NegSyn_220306_catch_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d543843f625568234cbf53fcc7242722bcce5c4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/NegSyn_220306_catch_operation_003.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that error occurs when any from catch is applied to 1D array and index target has wrong type + ** @verdict pass reject + *****************************************************************/ +// The following requirements are tested: +// The catch on any port from a port array operation can not be used to catch a call timeout. +module NegSyn_220306_catch_operation_003 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, 10) }; + } + } + + testcase TC_NegSyn_220306_catch_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var float v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, 1.0) { + []any from p.catch(timeout) { setverdict(pass); } + } + } + + } + + control { + execute(TC_NegSyn_220306_catch_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_001.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cc41964972777aad854fdb07c446bbedbd5ef186 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_001.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch is not triggered if there hasn't been any exception + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To catch an exception on any port from a specific port array, use the any from PortArrayRef syntax +// where PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220306_catch_operation_001 { + signature S() exception (integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + testcase TC_Sem_220306_catch_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + } + alt + { + [] any from p.catch { setverdict(fail, "The any from catch operation produced incorrect match"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_002.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec83417860d78d662eb087fbbdaf86e1a198e086 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_002.ttcn @@ -0,0 +1,51 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch matches if at least one port contains enqueued reply + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// To catch an exception on any port from a specific port array, use the any from PortArrayRef syntax +// where PortArrayRef shall be a reference to a port array identifier. +// The first port which matches all the criteria will cause the operation to be successful even if +// other ports in the array would also meet the criteria. +module Sem_220306_catch_operation_002 { + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, 1) }; + } + } + + testcase TC_Sem_220306_catch_operation_002() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch { setverdict(pass); } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_003.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c70f33f5832195548b319202a82c1557da222d2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_003.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch doesn't assign index when there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220306_catch_operation_003 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, i + 100) }; + } + } + + testcase TC_Sem_220306_catch_operation_003() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:(1..10)) -> @index value v_index { + setverdict(fail, "The any from catch operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(not isbound(v_index)){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_220306_catch_operation_003(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_004.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4fb29bb6a2805cc7a5cad5a453e510553d10e412 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_004.ttcn @@ -0,0 +1,59 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch doesn't change index variable when no there's no suitable match + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +module Sem_220306_catch_operation_004 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, i + 100) }; + } + } + + testcase TC_Sem_220306_catch_operation_004() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index := 99; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:(1..10)) -> @index value v_index { + setverdict(fail, "The any from catch operation produced incorrect match"); + } + [else] { setverdict(pass); } + } + if(v_index == 99){ + setverdict(pass); + } else { + setverdict(fail, "Index incorrectly assigned"); + } + } + + control { + execute(TC_Sem_220306_catch_operation_004(), 5000.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_005.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..788a2d55ec24a01fa9cc69a3592d84a13ddc8a31 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_005.ttcn @@ -0,0 +1,60 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from done assigns index + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// It is also possible to store the index of a port in a single-dimensional port array at which +// the operation was successful to a variable of type integer or, in case of multi-dimensional +// port arrays the index of the successful port to an integer array or record of integer variable. +// When checking the port array for matching exceptions, the port indices to be checked are iterated +// from lowest to highest. +module Sem_220306_catch_operation_005 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, i + 1); }; + } + } + + testcase TC_Sem_220306_catch_operation_005() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create; + var integer v_index, v_res; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:(0..c_portCount)) -> value v_res @index value v_index { + if(v_index == 1 and v_res == v_index + 1){ + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_006.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99706ee23102078c6e3df49dc6f2165776dc724a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_006.ttcn @@ -0,0 +1,64 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify that any from catch index redirection works for multidimensional arrays + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction j: +// If the index redirection is used for multi-dimensional component arrays, the size +// of the integer array or record of integer type shall exactly be the same as the dimension +// of the respective array, and its type shall allow storing the highest index (from all +// dimensions) of the array. +module Sem_220306_catch_operation_006 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 3; + type component GeneralComp + { + port P p[c_portCount][c_portCount]; + } + + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + p[i][j].getcall; + if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].raise(S, i + 1 ); } + } + } + } + + testcase TC_Sem_220306_catch_operation_006() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_index[2], v_parValue; + for(var integer i := 0; i < c_portCount; i := i + 1) { + for(var integer j := 0; j < c_portCount; j := j + 1) { + connect(self:p[i][j], v_ptc:p[i][j]); + p[i][j].call(S:{}, nowait); + } + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> sender v_src @index value v_index { + if(v_index[0] == 1 and v_index[1] == 2){ + setverdict(pass); + } else { + setverdict(fail, "Indices or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_007.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e476ee169c8e7f49fb00606f7d882bb2762cfd63 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_007.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify any from catch index redirection to lazy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction k +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the catch operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// catch operation. +module Sem_220306_catch_operation_007 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, i + 1) }; + } + } + testcase TC_Sem_220306_catch_operation_007() runs on GeneralComp system GeneralComp { + var @lazy integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> @index value v_index { + if(v_index == 1){ // no catch call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_008.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6345b39cd8a8ae6730e20c3e0ac619786af5aa63 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_008.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.3.6, Verify any from catch index redirection to fuzzy variable + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The following requirements are tested: +// Restriction k +// If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression +// assigned to this variable is equal to the result produced by the catch operation. Later +// evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the +// catch operation. +module Sem_220306_catch_operation_008 { + + signature S() exception(integer); + + type port P procedure { + inout S; + } + + const integer c_portCount := 4; + type component GeneralComp + { + port P p[c_portCount]; + } + function f() runs on GeneralComp + { + for(var integer i := 0; i < c_portCount; i := i + 1) { + p[i].getcall; + if (i mod 2 == 1) { p[i].raise(S, i + 1) }; + } + } + testcase TC_Sem_220306_catch_operation_008() runs on GeneralComp system GeneralComp { + var @fuzzy integer v_index; + var GeneralComp v_ptc := GeneralComp.create; + for(var integer i := 0; i < c_portCount; i := i + 1) { + connect(self:p[i], v_ptc:p[i]); + p[i].call(S:{}, nowait); + } + v_ptc.start(f()); + v_ptc.done; + alt + { + [] any from p.catch(S, integer:?) -> @index value v_index { + if(v_index == 1){ // no catch call during evaluation, v_index remains equal to 1 + setverdict(pass); + } else { + setverdict(fail, "Index or parameter value incorrectly assigned"); + } + } + [else] { setverdict(fail, "The any from catch operation didn't match for some reason"); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_009.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9423c411badf2ce22dd425f96fb2aa6d3820e97 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_009.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, @decoded redirect value assignment of a bitstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220306_catch_operation_009 { + type record R { + integer id, + bitstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 1, payload := encvalue(v_src) }; + p.getcall(S:?); + p.raise(S, v_rec); + log("dada"); + } + + testcase TC_Sem_220306_catch_operation_009() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_010.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71bd6982fa6404499bc2a75e37c65bbd9f807434 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_010.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, @decoded redirect value assignment of a hexstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220306_catch_operation_010 { + type record R { + integer id, + hexstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 2, payload := bit2hex(encvalue(v_src)) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_Sem_220306_catch_operation_010() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{ }) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_011.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a838d7e23869ce6812f13bee863b1bcf00df370f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_011.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, @decoded redirect value assignment of an octetstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220306_catch_operation_011 { + type record R { + integer id, + octetstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var charstring v_src := "abc"; + var R v_rec := { id := 3, payload := bit2oct(encvalue(v_src)) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_Sem_220306_catch_operation_011() runs on GeneralComp system GeneralComp { + var charstring v_res; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + if (v_res == "abc") { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + + } + } + + control { + execute(TC_Sem_220306_catch_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_012.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b984cccf12de5c283d8060a5851d34cfd6d9635 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_012.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, @decoded redirect value assignment of a charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220306_catch_operation_012 { + type record R { + integer id, + charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 4, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.raise(S, v_rec) + } + + testcase TC_Sem_220306_catch_operation_012() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + } + } + + control { + execute(TC_Sem_220306_catch_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_013.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1cd46b136bf3a56573f7ff987e7737b69a67a7b8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_013.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.3.6, @decoded redirect value assignment of a universal charstring field + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// When assigning individual fields of an exception, encoded payload fields can be +// decoded prior to assignment using the @decoded modifier. In this case, the +// referenced field on the right hand sided of the assignment shall be one of the +// bitstring, hexstring, octetstring, charstring or universal charstring types. It +// shall be decoded into a value of the same type as the variable on the left hand +// side of the assignment. + +module Sem_220306_catch_operation_013 { + type record R { + integer id, + universal charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { encode "32bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src) }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_Sem_220306_catch_operation_013() runs on GeneralComp system GeneralComp { + var integer v_res with { encode "32bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + } + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220306_catch_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_014.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..271d8c275986c7fe86bb5f469cc485dde43cd618 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_014.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:22.3.6, @decoded redirect value assignment with encoding parameter + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// In case the referenced field is of the universal charstring type, the @decoded +// clause can contain an optional parameter defining the encoding format. The +// parameter shall be of the charstring type and it shall contain one of the +// strings allowed for the decvalue_unichar function (specified in clause C.5.4). + +module Sem_220306_catch_operation_014 { + type record R { + integer id, + universal charstring payload + } + + signature S() exception (R); + + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f_server() runs on GeneralComp { + var integer v_src := 1953719668 with { variant "32 bit" }; + var R v_rec := { id := 5, payload := encvalue_unichar(v_src, "UTF-16LE") }; + p.getcall(S:?); + p.raise(S, v_rec); + } + + testcase TC_Sem_220306_catch_operation_014() runs on GeneralComp system GeneralComp { + var integer v_res with { variant "32 bit" }; + var GeneralComp v_ptc := GeneralComp.create("PTC"); + connect(self:p, v_ptc:p); + v_ptc.start(f_server()); + p.call(S:{}) { + [] p.catch(S, R:?) -> value (v_res := @decoded("UTF-16LE") payload) { + if (v_res == 1953719668) { setverdict (pass); } + else { setverdict(fail); } + } + [] p.catch { setverdict(fail); } + }; + v_ptc.done; + setverdict(pass); + } + + control { + execute(TC_Sem_220306_catch_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_015.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..056cf58201d3616dbd8b1b73541688c480d3ae17 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_015.ttcn @@ -0,0 +1,57 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.6, catch with a from clause (single item) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A catch operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220306_catch_operation_015 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220306_catch_operation_015() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_receiveCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.catch(S, charstring:?) from v_ptcs[0] { setverdict(pass); } // expected 1 from match + [] p.catch(S, charstring:?) { v_receiveCounter := v_receiveCounter + 1; } // expected 2 other received exceptions + } + } + if (v_receiveCounter != c_ptcCount - 1) { setverdict(fail); } + } + + control { + execute(TC_Sem_220306_catch_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_016.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da1050acb357f4ab70dc84f79073989b1be3ab3b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_016.ttcn @@ -0,0 +1,58 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.6, catch with a from clause (multiple items) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A catch operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220306_catch_operation_016 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220306_catch_operation_016() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + var integer v_fromCounter := 0, v_noFromCounter := 0; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.catch(S, charstring:?) from (v_ptcs[0], v_ptcs[1]) { v_fromCounter := v_fromCounter + 1; } + [] p.catch(S, charstring:?) { v_noFromCounter := v_noFromCounter + 1; } + } + } + if (v_fromCounter == 2 and v_noFromCounter == 1) { setverdict(pass); } + else { setverdict(fail); } + } + + control { + execute(TC_Sem_220306_catch_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_017.ttcn b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5db027964fb14d3245ae232ceac9976978f39f1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2203_procedure_based_communication/220306_catch_operation/Sem_220306_catch_operation_017.ttcn @@ -0,0 +1,55 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.3.6, catch with a from clause (any component) + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// A catch operation may be restricted to a certain communication partner in case +// of one-to-many connections. This restriction shall be denoted by using the from +// keyword followed by a specification of an address or component reference, a list +// of address or component references or any component. + +module Sem_220306_catch_operation_017 { + + signature S() exception (charstring); + + type port P procedure { + inout S; + } + + type component GeneralComp + { + port P p; + } + + function f() runs on GeneralComp + { + p.getcall(S:{}); + p.raise(S, "exc"); + } + + const integer c_ptcCount := 3; + + testcase TC_Sem_220306_catch_operation_017() runs on GeneralComp system GeneralComp { + var GeneralComp v_ptcs[c_ptcCount]; + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + v_ptcs[i] := GeneralComp.create; + connect(self:p, v_ptcs[i]:p); + v_ptcs[i].start(f()); + p.call(S:{}, nowait) to v_ptcs[i]; + } + + for (var integer i := 0; i < c_ptcCount; i := i + 1) { + alt { + [] p.catch(S, charstring:?) from any component { setverdict(pass); } + [] p.catch(S, charstring:?) { setverdict(fail); } + } + } + } + + control { + execute(TC_Sem_220306_catch_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_001.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28e3ea3fd7974c458d9abe98a2718c912d408597 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.4, null component reference in from clause of check operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_2204_the_check_operation_001 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_2204_the_check_operation_001() runs on GeneralComp system GeneralComp { + var GeneralComp v_comp := null; + connect(self:p, self:p); + p.send(10); + alt { + [] p.check (from v_comp) {} + [] p.check {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2204_the_check_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_002.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab5267a426340326f4082e1d7ff4c6a72ec04239 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.4, null address reference in from clause of check operation + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// No AddressRef shall contain the special value null at the time of the operation. + +module NegSem_2204_the_check_operation_002 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp + { + port P p; + } + + testcase TC_NegSem_2204_the_check_operation_002() runs on GeneralComp { + var P.address v_addr1 := 1, v_addr2 := 2, v_addr3 := null; + p.send(10); + alt { + [] p.check (from (v_addr1, v_addr2, v_addr3)) {} + [] p.check {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2204_the_check_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_003.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0450ed31b77f2fbdb0d99a432b4903c73217fe32 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:22.4, incompatible from and sender clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the check operation contains both from and sender clause, the variable or parameter +// referenced in the sender clause shall be type compatible with the template in the from +// clause. + +module NegSem_2204_the_check_operation_003 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_2204_the_check_operation_003() runs on GeneralComp { + var address v_addr; + p.send(100); + alt { + [] p.check(from GeneralComp:? -> sender v_addr) { } + [] p.check {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2204_the_check_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_004.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab6ace11fb6f9e90e742f548f0b25b9c6cdea078 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_004.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.4, incompatible value in the from clause + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// All AddressRef items in the from clause and all VariableRef items in the sender clause +// shall be of type address, component or of the address type bound to the port type +// (see clause 6.2.9) of the port instance referenced in the check operation. + +module NegSem_2204_the_check_operation_004 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_2204_the_check_operation_004() runs on GeneralComp { + var address v_addr := 2; + var charstring v_addr2 := ""; + p.send(100) to v_addr; + alt { + [] p.check(from (v_addr, v_addr2)) { } + [] p.check {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2204_the_check_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_005.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56f9469f7237b330931e7834fcfdb191ef807f22 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/NegSem_2204_the_check_operation_005.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:22.4, verify that a runtime error is generated if the real sender is incompatible with the variable in sender redirect assignment + ** @verdict pass reject + *****************************************************************/ + +// The following requirements are tested: +// If the operation contains a sender clause but no from clause, the sender shall be type +// compatible with the variable or parameter referenced in the sender clause. + +module NegSem_2204_the_check_operation_005 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_NegSem_2204_the_check_operation_005() runs on GeneralComp { + var address v_addr := 2; + var GeneralComp v_ptc; + p.send(100) to v_addr; + alt { + [] p.check(-> sender v_ptc) { } + [] p.check {} + } + setverdict(pass); + } + + control { + execute(TC_NegSem_2204_the_check_operation_005()/*, 5.0*/); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_001.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2220c1683b776421fce19ffce9a995beda72ff56 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_001.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_001 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_001() runs on GeneralComp { + p.send(integer:1); + alt + { + [] p.check(receive) { setverdict(pass, "Check operation successful"); } + } + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_001(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_002.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..564c8475ef6357c6bd72075c9f3436251058d0f4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_002 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_002() runs on GeneralComp { + var integer v_addr; + p.send(integer:1) to 80; + alt + { + [] p.check(receive -> sender v_addr) { + if (v_addr == 80) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + } + } + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_002(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_003.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4117ec462cc4287b897a67e35724ab5e9754c345 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_003.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_003 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_003() runs on GeneralComp { + p.send(integer:1); + p.check(receive); + setverdict(pass, "Check operation successful"); + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_003(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_004.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..928e0db30a7e079a2bd32c94120d42c20bbb8e06 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_004.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(receive) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_004 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_004() runs on GeneralComp { + var integer v_addr; + p.send(integer:1) to 80; + p.check(receive -> sender v_addr); + if (v_addr == 80) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_004(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_005.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3679abfb141405885df67ffdc48244bb892eeba --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_005.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(receive) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_005 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_005() runs on GeneralComp { + p2.send(integer:1); + alt + { + [] any port.check(receive) { setverdict(pass, "Check operation successful"); } + } + any port.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_005(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_006.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b6fce2413d1ef862bfc006c23c95515640e16cb6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_006.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(receive) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_006 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_006() runs on GeneralComp { + var address v_addr; + p2.send(integer:1) to 80; + alt + { + [] any port.check(receive -> sender v_addr) { + if (v_addr == 80) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + } + } + any port.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_006(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_007.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c0e7a734b97aab205bd1536525bf2b0574767a6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_007.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(receive) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_007 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_007() runs on GeneralComp { + p.send(integer:1); + any port.check(receive); + setverdict(pass, "Check operation successful"); + any port.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_007(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_008.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..331074cf71a974bc6330aa896cd845e810e8934a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_008.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(receive) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_008 { + + type integer address; + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_008() runs on GeneralComp { + var address v_addr; + p.send(integer:1) to 80; + any port.check(receive -> sender v_addr); + if (v_addr == 80) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + any port.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_008(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_009.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3154b3a67819eca052a1605b5a1ec4b7ded0cb2a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_009.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_009 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_009() runs on GeneralComp { + p.send(integer:1); + alt + { + [] p.check(receive(integer:(100..200))) { setverdict(fail, "Incorrect match"); } + [] p.receive { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_009(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_010.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01543d372a68bbf80b1e5de01ccd2405bc45537b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_010.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_010 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_010() runs on GeneralComp { + var integer v_val; + p.send(integer:1) to 80; + alt + { + [] p.check(receive(integer:?) from P.address:(20..40) -> value v_val) { + setverdict(fail, "Incorrect match"); + } + [] p.receive { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_010(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_011.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cf35b932e79547418da26ef00ea3f39108cbfab3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_011.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify port.check(receive) behaviour in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_011 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.receive { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + testcase TC_Sem_2204_the_check_operation_011() runs on GeneralComp { + activate(a()); + p.send(integer:1); + p.check(receive(integer:(100..200))); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_011(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_012.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02ba6c1ad3373e867d6f88a756b5738acebfb64c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_012.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_012 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + var integer v_addr; + } + + altstep a() runs on GeneralComp { + [] p.receive { + if (not isbound(v_addr)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The address value should still be undefined at this point"); } + stop; + } + } + testcase TC_Sem_2204_the_check_operation_012() runs on GeneralComp { + activate(a()); + p.send(integer:1) to 80; + p.check(receive(integer:(100..200)) from P.address:(20..100) -> sender v_addr); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_012(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_013.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8f618488cf104dc0af645349ccc779c82d8f720 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_013.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify any port.check(receive) behaviour in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_013 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_013() runs on GeneralComp { + p2.send(integer:1); + alt + { + [] any port.check(receive(integer:(100..200))) { setverdict(fail, "Incorrect match"); } + [] any port.receive { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_013(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_014.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1c86bf3aa78317fe0a386bb208158aa67d5a686 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_014.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(receive) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_014 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_014() runs on GeneralComp { + var integer v_val; + p2.send(integer:1) to 80; + alt + { + [] any port.check(receive(integer:?) from address:(20..40) -> value v_val) { + setverdict(fail, "Incorrect match"); + } + [] any port.receive { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_014(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_015.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bfb66b7fc4a710e854c8b9b794c9035a712f33a9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_015.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify any port.check(receive) behaviour in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_015 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + altstep a() runs on GeneralComp { + [] any port.receive { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + testcase TC_Sem_2204_the_check_operation_015() runs on GeneralComp { + activate(a()); + p2.send(integer:1); + any port.check(receive(integer:(100..200))); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_015(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_016.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6284a7065c09ee9ce4291ec99eec12efe13336f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_016.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(receive) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_016 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + var address v_addr; + } + + altstep a() runs on GeneralComp { + [] any port.receive { + if (not isbound(v_addr)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The address value should still be undefined at this point"); } + stop; + } + } + testcase TC_Sem_2204_the_check_operation_016() runs on GeneralComp { + activate(a()); + p2.send(integer:1) to 80; + any port.check(receive(integer:(100..200)) from address:(20..100) -> sender v_addr); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_016(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_017.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a17b1957cd0b1736417f4a9b6e904b42156cc391 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_017.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_017 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_017() runs on GeneralComp { + p.send(integer:1); + alt + { + [] p.check(receive(integer:?)) { setverdict(pass, "Check operation successful"); } + } + p.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_017(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_018.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f83e426457cd3a90ffbd7fcff7e377dc9296dbf --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_018.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behation of port.check(receive) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_018 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_018() runs on GeneralComp { + var integer v_val, v_addr; + p.send(integer:1) to 80; + alt + { + [] p.check(receive(integer:(0..10)) from P.address:(10..100) -> value v_val sender v_addr) { + if (match(v_val, 1) and match(v_addr, 80)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect message value or address"); } + } + } + p.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_018(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_019.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..728d30d40eca3e3aa54f40d8656894945a4ad23d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_019.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_019 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_019() runs on GeneralComp { + p.send(integer:1); + p.check(receive(integer:?)); + setverdict(pass, "Check operation successful"); + p.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_019(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_020.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a02adb46bee41a0c90de7ade152851f2dc3ed2c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_020.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(receive) with assignment in case of successful match works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_020 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_020() runs on GeneralComp { + var integer v_val; + p.send(integer:1); + p.check(receive(integer:(0..10)) -> value v_val); + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + p.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_020(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_021.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b7ee515f795a497a128c4abc34cd8fe7d59cdd4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_021.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(receive) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_021 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_021() runs on GeneralComp { + p2.send(integer:1); + alt + { + [] any port.check(receive(integer:?)) { setverdict(pass, "Check operation successful"); } + } + any port.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_021(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_022.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b024cf6dccd100d8447075ae3a25e3dfb55600dd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_022.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behation of any port.check(receive) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_022 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_022() runs on GeneralComp { + var integer v_val, v_addr; + p2.send(integer:1) to 80; + alt + { + [] any port.check(receive(integer:(0..10)) from address:(10..100) -> value v_val sender v_addr) { + if (match(v_val, 1) and match(v_addr, 80)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect message value or address"); } + } + } + any port.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_022(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_023.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36d16d8cbe5bd16b53127a6c2b6e78885c148585 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_023.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(receive) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_023 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_023() runs on GeneralComp { + p2.send(integer:1); + any port.check(receive(integer:?)); + setverdict(pass, "Check operation successful"); + any port.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_023(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_024.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b08ccea3d8a76d4b2d568c74160852421fa73e3c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_024.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(receive) with assignment in case of successful match works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_024 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_024() runs on GeneralComp { + var integer v_val; + p2.send(integer:1); + any port.check(receive(integer:(0..10)) -> value v_val); + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect address value"); } + any port.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_024(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_025.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc9bc81afdf4f63938a6791f212923b10d853e12 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_025.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getcall) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_025 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + alt + { + [] p.check(getcall) { setverdict(pass, "Check operation successful"); } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_025() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_025(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_026.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7ef282890958e88632afe1ce85cbe45f5a4bff1e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_026.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getcall) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_026 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] p.check(getcall -> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_026() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_026(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_027.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd8ecabfe5189bea94071561208dc79dcaf41efe --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_027.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getcall) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_027 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.check(getcall); + setverdict(pass, "Check operation successful"); + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_027() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_027(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_028.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76ed0c0be42ca573c79e734cbc7a3894101f02ae --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_028.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getcall) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_028 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + p.check(getcall -> sender v_src); + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_028() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_028(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_029.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fdfdf241cfd5b82eaa6b745f23236b4ea5cc8bc --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_029.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getcall) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_029 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + alt + { + [] any port.check(getcall) { setverdict(pass, "Check operation successful"); } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_029() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_029(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_030.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7fecff79e7a83461d7b2aec537aa7f8459455cf --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_030.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getcall) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_030 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] any port.check(getcall -> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_030() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_030(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_031.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fddc756328b8836f2a294a78ebdc03dd6db35ead --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_031.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getcall) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_031 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + any port.check(getcall); + setverdict(pass, "Check operation successful"); + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_031() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_031(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_032.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e1a89374d026fd5386407d30a3bea4d1336cbdb0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_032.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getcall) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_032 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + any port.check(getcall -> sender v_src); + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_032() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_032(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_033.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7950b4cf529c6588daf0d22447760379cca6439f --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_033.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_033 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + alt + { + [] p.check(getcall(S:{ p_par1 := (0, 2, 4, 6)})) { setverdict(fail, "Incorrect match"); } + [] p.getcall { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + testcase TC_Sem_2204_the_check_operation_033() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_033(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_034.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d0857d626a6b2176aa1ab9e0a2f4b172ccb6dfb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_034.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_034 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var integer v_val; + alt + { + [] p.check(getcall(S:{ p_par1 := (0, 2, 4, 6)}) -> param(v_val := p_par1)) { + setverdict(fail, "Incorrect match"); + } + [] p.getcall { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + } + } + } + + testcase TC_Sem_2204_the_check_operation_034() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_034(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_035.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d976df95afa383f53cb3e28c3baf943cdc078ad2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_035.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_035 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + altstep a() runs on GeneralComp { + [] p.getcall { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + function f() runs on GeneralComp { + activate(a()); + p.check(getcall(S:{ p_par1 := (0, 2, 4, 6)})); + setverdict(fail, "Incorrect match"); + } + + testcase TC_Sem_2204_the_check_operation_035() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_035(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_036.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1dd9fef9520841da619139c33c254090165c9149 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_036.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_036 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + var integer v_val; + } + + altstep a() runs on GeneralComp { + [] p.getcall { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + stop; + } + } + + function f() runs on GeneralComp { + activate(a()); + p.check(getcall(S:{ p_par1 := (0..10)}) from self -> param(v_val := p_par1)); + setverdict(fail, "Incorrect match"); + } + + testcase TC_Sem_2204_the_check_operation_036() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_036(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_037.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d57ae57a107563a1c302bf7133e2505653255c0c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_037.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_037 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + alt + { + [] any port.check(getcall(S:{ p_par1 := (0, 2, 4, 6)})) { setverdict(fail, "Incorrect match"); } + [] any port.getcall { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + testcase TC_Sem_2204_the_check_operation_037() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_037(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_038.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03d641706f9f846ff871d14979d4584cc2cdddc8 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_038.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_038 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var integer v_val; + alt + { + [] any port.check(getcall(S:{ p_par1 := (0, 2, 4, 6)}) -> param(v_val := p_par1)) { + setverdict(fail, "Incorrect match"); + } + [] any port.getcall { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + } + } + } + + testcase TC_Sem_2204_the_check_operation_038() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_038(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_039.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e48392ff6a3af615721a6c0eb7ab81f945979491 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_039.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_039 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + altstep a() runs on GeneralComp { + [] any port.getcall { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + function f() runs on GeneralComp { + activate(a()); + any port.check(getcall(S:{ p_par1 := (0, 2, 4, 6)})); + setverdict(fail, "Incorrect match"); + } + + testcase TC_Sem_2204_the_check_operation_039() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_039(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_040.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7127055c2272ee0c0e9579608398cb5a049fc80a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_040.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_040 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + var integer v_val; + } + + altstep a() runs on GeneralComp { + [] any port.getcall { + if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The value should still be undefined at this point"); } + stop; + } + } + + function f() runs on GeneralComp { + activate(a()); + any port.check(getcall(S:{ p_par1 := (0..10)}) from self -> param(v_val := p_par1)); + setverdict(fail, "Incorrect match"); + } + + testcase TC_Sem_2204_the_check_operation_040() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_040(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_041.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76df1bbd2a485a94e9f0e38ba0ea8dc4c4faa62d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_041.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_041 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + alt + { + [] p.check(getcall(S:{ p_par1 := (0..10)})) { setverdict(pass, "Check operation successful"); } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_041() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_041(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_042.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee72de0222317e89f46f087ee7b45d77bca8125c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_042.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_042 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var integer v_val; + var GeneralComp v_src; + alt + { + [] p.check(getcall(S:{ p_par1 := (0..10)}) from GeneralComp:? -> param (v_val) sender v_src) { + if (match(v_val, 1) and match(v_src, mtc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter value or sender"); } + } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_042() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_042(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_043.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac019da1a10f32090d87422f1c754cd233ff0ab2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_043.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_043 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.check(getcall(S:{ p_par1 := (0..10)}) from mtc); + setverdict(pass, "Check operation successful"); + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_043() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_043(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_044.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22647fcd921009224f3789b211cf789fb4caf137 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_044.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getcall) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_044 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var integer v_val; + p.check(getcall(S:{ p_par1 := (0..10)}) -> param (v_val)); + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter value"); } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_044() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_044(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_045.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1658410b45ab89df2e4908e13e7a9f1d5b66312 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_045.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_045 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + alt + { + [] any port.check(getcall(S:{ p_par1 := (0..10)})) { setverdict(pass, "Check operation successful"); } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_045() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_045(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_046.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28c92898da8ab453ad7b89afc7e98ac80689bef4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_046.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_046 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var integer v_val; + var GeneralComp v_src; + alt + { + [] any port.check(getcall(S:{ p_par1 := (0..10)}) from GeneralComp:? -> param (v_val) sender v_src) { + if (match(v_val, 1) and match(v_src, mtc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter value or sender"); } + } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_046() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_046(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_047.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e3b43d1fe2749a50661d79d9ee223c5f132ac5a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_047.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_047 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + any port.check(getcall(S:{ p_par1 := (0..10)}) from mtc); + setverdict(pass, "Check operation successful"); + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_047() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_047(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_048.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1afb2a7c212d59f09f708f974c1927e0d198f4d0 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_048.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getcall) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_048 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var integer v_val; + any port.check(getcall(S:{ p_par1 := (0..10)}) -> param (v_val)); + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter value"); } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_048() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_048(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_049.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_049.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9eedf6d050ea3a47466c039defbd0710ab7c73fa --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_049.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getreply) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_049 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_049() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply) { setverdict(pass, "Check operation successful"); } + } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_049(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_050.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_050.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ade46fb74f3b8044ff1a1979c7feb1dc34277d38 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_050.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getreply) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_050 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_050() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + } + } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_050(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_051.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_051.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d646d671061302ed6238248f709be57a795d327 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_051.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getreply) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_051 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_051() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(getreply); + setverdict(pass, "Check operation successful"); + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_051(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_052.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_052.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a4b68254a48b10c0554bce376e9f7068e3c3cef --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_052.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(getreply) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_052 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_052() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(getreply -> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_052(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_053.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_053.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b35c06c62ebc364833cefbef73233614df0553aa --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_053.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getreply) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_053 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_053() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply) { setverdict(pass, "Check operation successful"); } + } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_053(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_054.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_054.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a78277f3699e5cd612933ae866f4db3f2951c24 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_054.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getreply) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_054 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_054() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + } + } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_054(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_055.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_055.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40926837b0970172b43641a9fc39d4ca98cbaa4c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_055.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getreply) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_055 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_055() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(getreply); + setverdict(pass, "Check operation successful"); + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_055(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_056.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_056.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d53b9fe359bf4702565a67fae7041cbf230a5ac --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_056.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(getreply) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_056 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_056() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(getreply -> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_056(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_057.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_057.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..094f1655716960688deb9e82e680aa504b1a6d41 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_057.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_057 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_057() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply(S:{p_par1 := (100..200)} value ?)) { setverdict(fail, "Incorrect match"); } + [] p.getreply { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_057(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_058.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_058.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04870865479f50658b9f8180fd969363638413c2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_058.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_058 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_058() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply(S:{p_par1 := ?} value (100..200)) -> value v_val param (v_par := p_par1)) { + setverdict(fail, "Incorrect match"); + } + [] p.getreply { + if (not isbound(v_par) and not isbound(v_val)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_par and v_val variables should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_058(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_059.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_059.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c169cb40af944355acc201713ec8b43c4c9b0f9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_059.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_059 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] p.getreply { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_059() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + p.check(getreply(S:? value ?) from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_059(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_060.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_060.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8b946b0cbb2dc99d3877d3b445ebb73847d8401 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_060.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_060 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + var integer v_val; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] p.getreply { + if (not isbound(v_val) and not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val and v_src variables should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_060() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + p.check(getreply(S:{p_par1 := ?} value (100..200)) -> value v_val sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_060(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_061.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_061.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db1633fa3a2b54893d3224b273b8940739ecb9d7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_061.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_061 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_061() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply(S:{p_par1 := (100..200)} value ?)) { setverdict(fail, "Incorrect match"); } + [] any port.getreply { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_061(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_062.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_062.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9081b04e1c588332ab80e7ff169a299c27f6e079 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_062.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_062 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_062() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply(S:{p_par1 := ?} value (100..200)) -> value v_val param (v_par := p_par1)) { + setverdict(fail, "Incorrect match"); + } + [] any port.getreply { + if (not isbound(v_par) and not isbound(v_val)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_par and v_val variables should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_062(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_063.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_063.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1901691d9216da9a1037b662c7472b35852e3df --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_063.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_063 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] any port.getreply { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_063() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + any port.check(getreply(S:? value ?) from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_063(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_064.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_064.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e616bdd9eb57a99e6a1d651594511759af60febd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_064.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_064 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + var integer v_val; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] any port.getreply { + if (not isbound(v_val) and not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val and v_src variables should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_064() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + any port.check(getreply(S:{p_par1 := ?} value (100..200)) -> value v_val sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_064(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_065.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_065.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e7d1e199ec44c08a187fa1782b39aef2ed32c93 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_065.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_065 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_065() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply(S:{ p_par1 := ?} value integer:(0..10))) { + setverdict(pass, "Check operation successful"); + } + } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_065(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_066.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_066.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f736263254cd14cd50766dbef34c73e765fd2b0a --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_066.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_066 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_066() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply(S:{ p_par1 := ?} value integer:(0..10)) -> value v_val param (v_par := p_par1)) { + if ( match(v_par, 1) and match(v_val, 5)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter or return value"); } + } + } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_066(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_067.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_067.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..465adb8ae27952d53b3582e1423e39e89b6f12dc --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_067.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_067 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_067() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + p.check(getreply(S:{ p_par1 := ?} value integer:(0..10)) from v_ptc); + setverdict(pass, "Check operation successful"); + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_067(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_068.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_068.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82cd209d740e9a5bd530144c27e8821e5372aec4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_068.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(getreply) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_068 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1 } value 5); + } + + testcase TC_Sem_2204_the_check_operation_068() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_val; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] p.check(getreply(S:{ p_par1 := complement(4, 5, 6) } value integer:?) -> value v_val sender v_src) { + if ( match(v_val, 5) and match(v_src, v_ptc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect return value or sender"); } + } + } + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_068(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_069.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_069.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7dba968a3931472e0e9c305b9205fbca5602e646 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_069.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_069 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_069() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply(S:{ p_par1 := ?} value integer:(0..10))) { + setverdict(pass, "Check operation successful"); + } + } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_069(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_070.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_070.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..627e246cd819e51c0d0e5717c6ab7415f467cf1c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_070.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_070 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_070() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply(S:{ p_par1 := ?} value integer:(0..10)) -> value v_val param (v_par := p_par1)) { + if (match(v_par, 1) and match(v_val, 5)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect parameter or return value"); } + } + } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_070(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_071.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_071.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12395441c7f256cc5b9ecd8bdc6d16df4332a255 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_071.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_071 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_071() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + any port.check(getreply(S:{ p_par1 := ?} value integer:(0..10)) from v_ptc); + setverdict(pass, "Check operation successful"); + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_071(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_072.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_072.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b714772af5e4d34269164a3d37856aa25ce6fb7 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_072.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(getreply) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_072 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1 } value 5); + } + + testcase TC_Sem_2204_the_check_operation_072() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(getreply(S:{ p_par1 := complement(4, 5, 6) } value integer:?) -> value v_val sender v_src) { + if (match(v_val, 5) and match(v_src, v_ptc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect return value or sender"); } + } + } + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_072(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_073.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_073.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d64f09fca029788c208ebf94e265a78428eadef --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_073.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(catch) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_073 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_073() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch) { setverdict(pass, "Check operation successful"); } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_073(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_074.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_074.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ef38f4f9a6739258c86ab9bf60ac78e02711d23 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_074.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(catch) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_074 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_074() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_074(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_075.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_075.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..72da38563fe6ac103e69fbd350235fa317d154bf --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_075.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(catch) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_075 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_075() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(catch); + setverdict(pass, "Check operation successful"); + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_075(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_076.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_076.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ee52509bb3e7b9c2b89709fff9250d3488d5712 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_076.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check(catch) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_076 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_076() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(catch -> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_076(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_077.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_077.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c592b45031023a15b43afde2e35d598f6a822d63 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_077.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(catch) works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_077 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_077() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch) { setverdict(pass, "Check operation successful"); } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_077(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_078.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_078.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82f11a4e6bb296f598b66a56882e9920ea193d4b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_078.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(catch) with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_078 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_078() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_078(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_079.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_079.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1bb0e42a87d8aa8a0c304e14cacfe0cb735961e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_079.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(catch) works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_079 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_079() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(catch); + setverdict(pass, "Check operation successful"); + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_079(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_080.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_080.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ac1a6d84510b9e8ce10d8dda7e47c53f8b5c159 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_080.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(catch) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_080 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_080() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(catch -> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_080(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_081.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_081.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d20ce4c9e25a361158e2deefa71e1ef13ab00478 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_081.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_081 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_081() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch(S, integer:(100..200))) { setverdict(fail, "Incorrect match"); } + [] p.catch { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_081(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_082.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_082.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..95b28aa6525036d31a017bf9b0cb717156e133dd --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_082.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_082 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_082() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_val; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch(S, integer:(100..200)) -> value v_val) { + setverdict(fail, "Incorrect match"); + } + [] p.catch { + if (not isbound(v_val)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val variable should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_082(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_083.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_083.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cd30afb1a7b3a678e82f13593031f89c3226916 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_083.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_083 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] p.catch { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_083() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(catch(S, integer:?) from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_083(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_084.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_084.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b8df350ac57d146a81ba7dedb311c9c1b7549c3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_084.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_084 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + var integer v_val; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] p.catch { + if (not isbound(v_val) and not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val and v_src variables should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_084() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(catch(S, integer:(100..200)) -> value v_val sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_084(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_085.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_085.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66e304caff27a4987129efb05f38393f8b07e060 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_085.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_085 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_085() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch(S, integer:(100..200))) { setverdict(fail, "Incorrect match"); } + [] any port.catch { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_085(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_086.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_086.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a86a5cc176da292f3b29b00163b0d193c7d15ba3 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_086.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_086 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_086() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch(S, integer:(100..200)) -> value v_val) { + setverdict(fail, "Incorrect match"); + } + [] any port.catch { + if (not isbound(v_val)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val variable should still be undefined at this point"); } + } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_086(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_087.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_087.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e5d71224dac38c0070386385552206b64ba0a3e4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_087.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_087 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] any port.catch { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_087() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(catch(S, integer:?) from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_087(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_088.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_088.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7dd4fe51be07be4f3362bd837bf0e592f88e684c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_088.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_088 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + var integer v_val; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] any port.catch { + if (not isbound(v_val) and not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_val and v_src variables should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_088() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(catch(S, integer:(100..200)) -> value v_val sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_088(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_089.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_089.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d69694dc2f04bd12cb181898c04a35b2bc653eef --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_089.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_089 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_089() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch(S, integer:(0..10))) { + setverdict(pass, "Check operation successful"); + } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_089(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_090.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_090.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a8553562f634c4e94543e0d198f6676ffc1d22b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_090.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_090 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_090() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_par, v_val; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch(S, integer:(0..10)) -> value v_val) { + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect exception value"); } + } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_090(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_091.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_091.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4eef9fcf41a2c9d63419cea838b441c9630abcbb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_091.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_091 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_091() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(catch(S, integer:?) from v_ptc); + setverdict(pass, "Check operation successful"); + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_091(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_092.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_092.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c586b71d18054b940acc29c3e1ed4d71b670964 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_092.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check(catch) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_092 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_092() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_val; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(catch(S, integer: complement(4, 5, 6)) -> value v_val sender v_src) { + if (match(v_val, 1) and match(v_src, v_ptc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect exception value or sender"); } + } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_092(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_093.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_093.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fd7b56dc24bb1a7be334e4d32cb4abf42d69809 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_093.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_093 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_093() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch(S, integer:(0..10))) { + setverdict(pass, "Check operation successful"); + } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_093(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_094.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_094.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bffccdf62cfc3a0fab18a04e28b7965425474c72 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_094.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_094 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_094() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + var integer v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch(S, integer:(0..10)) -> value v_val) { + if (v_val == 1) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect exception value"); } + } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_094(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_095.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_095.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c54e6c84d82bfc26148d71bd532082fdd4307284 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_095.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_095 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_095() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(catch(S, integer:?) from v_ptc); + setverdict(pass, "Check operation successful"); + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_095(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_096.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_096.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ae1f1ee5c6fdd3bd38ea92c88696c3182f2db94 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_096.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check(catch) with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_096 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_096() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + var integer v_val; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(catch(S, integer:complement(4, 5, 6)) -> value v_val sender v_src) { + if (match(v_val, 1) and match(v_src, v_ptc)) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect exception value or sender"); } + } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_096(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_097.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_097.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88fec8d1af60836540e1b521a27d0125228bc554 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_097.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_097 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_097() runs on GeneralComp { + p.send(integer:1); + alt + { + [] p.check { setverdict(pass, "Check operation successful"); } + } + p.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_097(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_098.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_098.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6e621b4f8b9eff12700c36ec233416c25112a2d --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_098.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_098 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] p.check(-> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_098() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_098(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_099.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_099.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c1c916c8448de578a642e0b5141bc7d79ae619c --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_099.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_099 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_099() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check; + setverdict(pass, "Check operation successful"); + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_099(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_100.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_100.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64d7add12d14fc9ca60adf536a12405e8e6ada18 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_100.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that port.check with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_100 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_100() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(-> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_100(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_101.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_101.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65ba722e109a4f32b39cc41e6cd170706e8f0307 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_101.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_101 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_101() runs on GeneralComp { + p2.send(integer:1); + alt + { + [] any port.check { setverdict(pass, "Check operation successful"); } + } + any port.receive; + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_101(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_102.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_102.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ea4183bc80490ba4307ee631a9dd3d113c4c64c6 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_102.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check with assignment works correctly inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_102 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] any port.check(-> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Unexpected sender value"); } + } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_102() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_102(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_103.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_103.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..871e4f3748ee84ef720dc4ddc384d2937d1610aa --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_103.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_103 { + + signature S(); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{}); + } + + testcase TC_Sem_2204_the_check_operation_103() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check; + setverdict(pass, "Check operation successful"); + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_103(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_104.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_104.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e758959d83278ea890baaceb7a9b6963464b7ec --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_104.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify that any port.check(catch) with assignment works correctly as standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_104 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_104() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(-> sender v_src); + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Counterpart mismatch"); } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_104(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_105.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_105.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4899a993b046cb9f1b7058833539456c745d6bb4 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_105.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_105 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_105() runs on GeneralComp { + p.send(integer:1) to 80; + alt + { + [] p.check(from 8080) { setverdict(fail, "Incorrect match"); } + [] p.receive { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_105(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_106.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_106.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf9fd4a5944f32ddfccba7ea53fa5cef4903556b --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_106.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_106 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] p.check(from self -> sender v_src) { + setverdict(fail, "Incorrect match"); + } + [] p.getcall { + if (not isbound(v_src)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The v_src variable should still be undefined at this point"); } + } + } + } + + testcase TC_Sem_2204_the_check_operation_106() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_106(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_107.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_107.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ecc2439c20643ff8ec599c7405f97e33b76f5ffb --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_107.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_107 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] p.getreply { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_107() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + p.check(from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_107(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_108.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_108.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3b69157b089cf1777cf4e9d40896a1a6adea96a9 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_108.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_108 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] p.catch { + if (not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_src variable should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_108() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + p.check(from self -> sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_108(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_109.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_109.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15e78bd697074f7093cec326a6471e9544b62812 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_109.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify any port.check behaviour in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_109 { + + type integer address; + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_109() runs on GeneralComp { + p2.send(integer:1) to 80; + alt + { + [] any port.check(from 8080) { setverdict(fail, "Incorrect match"); } + [] any port.receive { setverdict(pass, "As expected, the check operation didn't match"); } + } + } + + control { + execute(TC_Sem_2204_the_check_operation_109(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_110.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_110.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b293126389ccae2bba720b4e03f73966a44af10 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_110.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check with assignment in case of unsuccessful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_110 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] any port.check(from self -> sender v_src) { + setverdict(fail, "Incorrect match"); + } + [] any port.getcall { + if (not isbound(v_src)) { setverdict(pass, "As expected, the check operation didn't match"); } + else { setverdict(fail, "The v_src variable should still be undefined at this point"); } + } + } + } + + testcase TC_Sem_2204_the_check_operation_110() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_110(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_111.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_111.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15ef8ce5717c7fdbd6a965e5137413268a9689ba --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_111.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_111 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + altstep a() runs on GeneralComp { + [] any port.getreply { + setverdict(pass, "As expected, the check operation didn't match"); + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_111() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := - }, nowait); + v_ptc.start(f()); + any port.check(from self); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_111(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_112.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_112.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0220f111bb9aee9386509d2865f62ed9e17550fe --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_112.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check with assignment in case of unsuccessful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_112 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + var GeneralComp v_src; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + altstep a() runs on GeneralComp { + [] any port.catch { + if (not isbound(v_src)) { + setverdict(pass, "As expected, the check operation didn't match"); + } + else { setverdict(fail, "The v_src variable should still be undefined at this point"); } + stop; + } + } + + testcase TC_Sem_2204_the_check_operation_112() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + activate(a()); + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + any port.check(from self -> sender v_src); + setverdict(fail, "Incorrect match"); + } + + control { + execute(TC_Sem_2204_the_check_operation_112(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_113.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_113.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db8ca41c9c72b98cd7e74e50c5178c0301230f98 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_113.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_113 { + + type port P message { + inout integer; + address integer; + } + + type component GeneralComp { + port P p; + } + + testcase TC_Sem_2204_the_check_operation_113() runs on GeneralComp { + p.send(integer:1) to 80; + alt + { + [] p.check(from P.address:(80, 8080)) { setverdict(pass, "Check operation successful"); } + } + p.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_113(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_114.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_114.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cf68ed2e5fefa426c66b037fab53601767a2dad --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_114.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_114 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] p.check(from GeneralComp:? -> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect sender"); } + } + } + p.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_114() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_114(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_115.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_115.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3785f529e8ad7183953fb792550fea82504061ab --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_115.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_115 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_115() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p, v_ptc:p); + p.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + p.check(from v_ptc); + setverdict(pass, "Check operation successful"); + p.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_115(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_116.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_116.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca695a1d2295b02faaeb810bd36009f60633f122 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_116.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of port.check with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_116 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p; + } + + function f() runs on GeneralComp { + p.getcall; + setverdict(pass, "Call received"); + p.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_116() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p, v_ptc:p); + p.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] p.check(from GeneralComp:? -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect sender"); } + } + } + p.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_116(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_117.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_117.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c944c4be6b3a859dc77d208335729f60bf5c2d05 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_117.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_117 { + + type port P message { + inout integer; + } + + type component GeneralComp { + port P p1, p2; + } + + testcase TC_Sem_2204_the_check_operation_117() runs on GeneralComp { + p2.send(integer:1); + alt + { + [] any port.check { setverdict(pass, "Check operation successful"); } + } + any port.receive(integer:?); + setverdict(pass, "Message still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_117(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_118.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_118.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd8253afeba1c3edb467389fc7bf7ad7246b0ff2 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_118.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check with assignment in case of successful match inside alt + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_118 { + + signature S(integer p_par1); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + var GeneralComp v_src; + alt + { + [] any port.check(from GeneralComp:? -> sender v_src) { + if (v_src == mtc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect sender"); } + } + } + any port.getcall; + setverdict(pass, "Call still on the top of the queue"); + } + + testcase TC_Sem_2204_the_check_operation_118() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := 1 }, nowait); + v_ptc.start(f()); + v_ptc.done; + } + + control { + execute(TC_Sem_2204_the_check_operation_118(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_119.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_119.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..88aeb500a4a10f70997e478cc66faf9b563a680e --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_119.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_119 { + + signature S(out integer p_par1) return integer; + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.reply(S:{ p_par1 := 1} value 5); + } + + testcase TC_Sem_2204_the_check_operation_119() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{ p_par1 := -}, nowait); + v_ptc.start(f()); + any port.check(from v_ptc); + setverdict(pass, "Check operation successful"); + any port.getreply; + setverdict(pass, "Reply still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_119(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_120.ttcn b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_120.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccba25350f1ae750e855059f8fef45b73ba6c277 --- /dev/null +++ b/ATS/core_language/22_communication_operations/2204_the_check_operation/Sem_2204_the_check_operation_120.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:22.4, Verify behaviour of any port.check with assignment in case of successful match in standalone statement + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +module Sem_2204_the_check_operation_120 { + + signature S() exception(integer); + type port P procedure { + inout S; + } + + type component GeneralComp { + port P p1, p2; + } + + function f() runs on GeneralComp { + p2.getcall; + setverdict(pass, "Call received"); + p2.raise(S, integer:1); + } + + testcase TC_Sem_2204_the_check_operation_120() runs on GeneralComp system GeneralComp{ + var GeneralComp v_ptc := GeneralComp.create, v_src; + connect(self:p1, v_ptc:p1); + connect(self:p2, v_ptc:p2); + p2.call(S:{}, nowait); + v_ptc.start(f()); + alt + { + [] any port.check(from GeneralComp:? -> sender v_src) { + if (v_src == v_ptc) { setverdict(pass, "Check operation successful"); } + else { setverdict(fail, "Incorrect exception value or sender"); } + } + } + any port.catch; + setverdict(pass, "Exception still on the top of the queue"); + } + + control { + execute(TC_Sem_2204_the_check_operation_120(), 5.0); + } +} \ No newline at end of file diff --git a/ATS/core_language/22_communication_operations/NOTES b/ATS/core_language/22_communication_operations/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..fbcdaf42dd549704c0204fba8878f1adec5f18b1 --- /dev/null +++ b/ATS/core_language/22_communication_operations/NOTES @@ -0,0 +1,5 @@ +Most aspects of message based communication have been tested in B_matching_incoming_values, +and most aspects of procedue based communication have been tested in +1502_declaring_signature_templates. This section contains test cases only for those +special aspects of communication operations, which have not been tested elsewhere. + diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_001.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22d9caf7a83c3d9d984c6ff0cdc971f438968d0a --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure infinity is not allowed + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Timer value is non-neg float + + +module NegSem_2302_timer_start_001 { + type component TComp{ + timer t_timer; + } + testcase TC_NegSem_2302_timer_start_001() runs on TComp{ + // Timer value shall be a non-negative numerical float number (i.e. the value shall be greater or equal 0.0, infinity and not_a_number are disallowed). + var float duration := infinity; + t_timer.start(duration); + } + control{ + + execute(TC_NegSem_2302_timer_start_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_002.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04b5359159f36255fe59e02b621c36865416172e --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure not_a_number is not allowed + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Timer value is non-neg float + + +module NegSem_2302_timer_start_002 { + type component TComp{ + timer t_timer; + } + testcase TC_NegSem_2302_timer_start_002() runs on TComp{ + // Timer value shall be a non-negative numerical float number (i.e. the value shall be greater or equal 0.0, infinity and not_a_number are disallowed). + var float duration := not_a_number; + t_timer.start(duration); + } + control{ + + execute(TC_NegSem_2302_timer_start_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_003.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca545e62c1bdc0b864534f648da908a10f2502b8 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure negative value is not allowed + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Timer value is non-neg float +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/neg timer value causes error verdict + +module NegSem_2302_timer_start_003 { + type component TComp{ + timer t_timer; + } + testcase TC_NegSem_2302_timer_start_003() runs on TComp{ + // Timer value shall be a non-negative numerical float number (i.e. the value shall be greater or equal 0.0, infinity and not_a_number are disallowed). + var float duration := -1.0; + t_timer.start(duration); + } + control{ + + execute(TC_NegSem_2302_timer_start_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_004.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..591d0bfd8f1b6b769c82be8191c859ffaf4c6655 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSem_2302_timer_start_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure negative infinity is not allowed + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Timer value is non-neg float + + +module NegSem_2302_timer_start_004 { + type component TComp{ + timer t_timer; + } + testcase TC_NegSem_2302_timer_start_004() runs on TComp{ + // Timer value shall be a non-negative numerical float number (i.e. the value shall be greater or equal 0.0, infinity and not_a_number are disallowed). + var float duration := -infinity; + t_timer.start(duration); + } + control{ + + execute(TC_NegSem_2302_timer_start_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_001.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07c708c5ba706471054ce1cbe442cc1a7744e0bf --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_001 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2302_timer_start_001() runs on TComp{ + t_timer.start(); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_002.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..043cc60b0e7a08b49a0e56f1a9dc41b1e4534da6 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_002 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_002() runs on TComp{ + + t_timers[].start; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_003.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8260cdeff2e3d1dceedbd8c0cc164663643d8c0 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ + + +module NegSyn_2302_timer_start_003 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_003() runs on TComp{ + + t_timers[1].start(); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_004.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9948df96b3c8489607e3793d58392be49c604cb5 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_004.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_004 { + type component TComp{ + + timer t_timer := 1.0; + } + testcase TC_NegSyn_2302_timer_start_004() runs on TComp{ + + t_timer.start 1.0; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_005.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5867ef56d6b09c9fa3124c24c045eac8c5a264bb --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_005.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_005 { + type component TComp{ + + timer t_timer := 1.0; + } + testcase TC_NegSyn_2302_timer_start_005() runs on TComp{ + + t_timer start(1.0); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_006.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05cf2735320fba222db6cb14fb7294531dd2c435 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_006.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_006 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_006() runs on TComp{ + + t_timers[1].start 1.0; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_007.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..63e74a8da611ce996498bedb2372741ba97aff2d --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_007.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_007 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_007() runs on TComp{ + + t_timers[1] start(1.0); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_007()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_008.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..60bace14fc09bda016f04edbb619016f2f27fa8e --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_008.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_008 { + type component TComp{ + + timer t_timer := 1.0; + } + testcase TC_NegSyn_2302_timer_start_008() runs on TComp{ + + t_timer start; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_008()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_009.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..372f4d9d05e5b47115a0ab3b7ae1995e5b63b9cf --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_009.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax + + +module NegSyn_2302_timer_start_009 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_009() runs on TComp{ + + t_timers[1] start; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_009()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_010.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd13b69ed0a3c75e78839a4b3dbf6579ff2d1e4d --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_010.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow any timer.start + +module NegSyn_2302_timer_start_010 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_010() runs on TComp{ + // This is not allowed by the TTCN3 grammar + any timer.start; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_010()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_011.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4b3f0bb67ff9fd8f8dfe56d32766dc53f50fcfb --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_011.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow any timer.start + +module NegSyn_2302_timer_start_011 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_011() runs on TComp{ + // This is not allowed by the TTCN3 grammar + any timer.start(1.0); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_011()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_012.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d390c40dd17b8ae8f5c97cf2e953033b4a66c33 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_012.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow all timer.start + +module NegSyn_2302_timer_start_012 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_012() runs on TComp{ + // This is not allowed by the TTCN3 grammar + all timer.start; + + } + control{ + + execute(TC_NegSyn_2302_timer_start_012()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_013.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c400d781efe64e429f67acd1a6a685706f9667fe --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/NegSyn_2302_timer_start_013.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer start syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Start timer syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow all timer.start + + +module NegSyn_2302_timer_start_013 { + type component TComp{ + + timer t_timers[3] := {1.0, 1.0, 1.0}; + } + testcase TC_NegSyn_2302_timer_start_013() runs on TComp{ + // This is not allowed by the TTCN3 grammar + all timer.start(1.0); + + } + control{ + + execute(TC_NegSyn_2302_timer_start_013()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_001.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f95d929c3eb78c8b0f71147c89b7e315cdc38cec --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_001.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:23, Ensure timer runs from zero to stated value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/timer clock runs from 0 to the value set + +module Sem_2302_timer_start_001 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Sem_2302_timer_start_001() runs on TComp{ + timer t_short, t_long; + var float v_elapsed; + var float v_last := 0.0; + + t_long.start(2.0); + t_timer.start(1.0); + t_short.start(0.5); + + while (t_short.running) { + v_elapsed := t_timer.read; + log("t_timer.read = ", v_elapsed); + if (v_elapsed<0.0 or v_elapsed < v_last){ + setverdict(fail) + } + v_last := v_elapsed; + } + while (t_timer.running) { + v_elapsed := t_long.read; + log("t_long.read = ", v_elapsed); + if (v_elapsed < v_last){ + setverdict(fail) + } + v_last := v_elapsed; + } + setverdict(pass); + + } + control{ + execute(TC_Sem_2302_timer_start_001()) + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_002.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd415764ee5005306ca5760d8ddd8ff6d6f2b640 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_002.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:23, Ensure timer can be restarted + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/timer can be restarted by repeated start operation + + +module Sem_2302_timer_start_002 { + type component TComp{ + } + + testcase TC_Sem_2302_timer_start_002() runs on TComp{ + timer t_short := 0.5, t_target := 1.0, t_long := 1.0; + + t_short.start; + t_target.start; + t_long.start; + + alt { + []t_short.timeout { + setverdict(pass); + t_target.start; // restart timer + } + []t_target.timeout { + setverdict(fail); + stop; + } + []t_long.timeout { + setverdict(fail); + stop; + } + } + alt { + []t_long.timeout { + setverdict(pass); + } + []t_target.timeout { + // Expected that t_target timeouts in 1.5 seconds since start: + // 0.5 sec. elapsed by t_short and 1.0 sec. by restarted timer + setverdict(fail); + stop; + } + } + } + control{ + + execute(TC_Sem_2302_timer_start_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_003.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54d5c2f05ba39688997e018e4d4d7ffc5e780244 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_003.ttcn @@ -0,0 +1,74 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:23, Ensure timer default value can be modified by start value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/timer clock runs from 0 to the value set +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Overridden timer value applies only to current instance + +module Sem_2302_timer_start_003 { + type component TComp{ + timer t_timer := 1.0; + } + + testcase TC_Sem_2302_timer_start_003() runs on TComp{ + timer t_short := 0.95, t_long := 1.05; + + t_long.start; + t_timer.start(0.9); + t_short.start; + + // t_timer is expected to expire before other timers: its duration 0.9 < t_short < t_long + alt { + []t_timer.timeout { + setverdict(pass); + } + []t_short.timeout { + setverdict(fail); + stop; + } + []t_long.timeout { + setverdict(fail); + stop; + } + } + + t_short.timeout; + t_long.timeout; + + t_long.start; + t_timer.start; + t_short.start; + // t_timer is expected to expire before between t_short and t_long timers: + // its default duration t_short < 1.0 < t_long + alt { + []t_short.timeout { + setverdict(pass); + } + []t_timer.timeout { + setverdict(fail); + stop; + } + []t_long.timeout { + setverdict(fail); + stop; + } + } + alt { + []t_timer.timeout { + setverdict(pass); + } + []t_long.timeout { + setverdict(fail); + stop; + } + } + } + control{ + + execute(TC_Sem_2302_timer_start_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_004.ttcn b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7baca242458c092da393347a6d98718adb9ccac9 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2302_the_start_timer_operataion/Sem_2302_timer_start_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:23, Ensure timer with value 0.0 expires immediately + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.2 The start timer operation/Timer with the timer value 0.0 times out immediately. + + +module Sem_2302_timer_start_004 { + type component TComp{ + timer t_timer := 0.0; + timer t_timer_with_long_default := 100.0; + } + + testcase TC_Sem_2302_timer_start_004() runs on TComp{ + t_timer.start; + if (t_timer.running) + { + setverdict(fail); + } + else + { + setverdict(pass); + } + + t_timer_with_long_default.start(0.0); + if (t_timer_with_long_default.running) + { + setverdict(fail); + } + else + { + setverdict(pass); + } + + + } + control{ + + execute(TC_Sem_2302_timer_start_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_001.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64e2278fe5b2d49595323c6ba75255ec4864164d --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + + +module NegSyn_2303_timer_stop_001 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2303_timer_stop_001() runs on TComp{ + t_timer.start; + t_timer stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_002.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..49610d8b56503c42841c3316c3616e639b5a3826 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + + +module NegSyn_2303_timer_stop_002 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2303_timer_stop_002() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + t_timer[].stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_003.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5681d750291b80827728529a9f8691eee1cc66f6 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure all timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + + +module NegSyn_2303_timer_stop_003 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2303_timer_stop_003() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + all.stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_004.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a16ea640c3871a322593c5a5f210c4c38fb5c5d4 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_004.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure all timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + + +module NegSyn_2303_timer_stop_004 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2303_timer_stop_004() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + timer.stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_005.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..532ab8b1b2a27c541ab0c5c0ee18558a7de04681 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_005.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure all timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + + +module NegSyn_2303_timer_stop_005 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2303_timer_stop_005() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + all timer stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_006.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b87cd1710dba885c2f731161e85be612b75a940 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/NegSyn_2303_timer_stop_006.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure all timer stop syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow any timer.stop + +module NegSyn_2303_timer_stop_006 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2303_timer_stop_006() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + any timer.stop; + + } + control{ + + execute(TC_NegSyn_2303_timer_stop_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_002.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e32601f130158d6f20818dcfa8dfadd4920cfda4 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure timer stop sets elapsed time to zero + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/stopped timer is inactive and elapsed time is 0 + + +module Sem_2303_timer_stop_002 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_Sem_2303_timer_stop_002() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + t_timer[0].stop; + if (t_timer[0].read!=0.0){ + setverdict(fail); + } + setverdict(pass); + + } + control{ + + execute(TC_Sem_2303_timer_stop_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_003.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de90cf2f941c99738928a59f4dc397582cf87b91 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_003.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure timer all timer identifier + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/all keyword can be used for timers in component or module control +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow all timer.stop + +module Sem_2303_timer_stop_003 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_Sem_2303_timer_stop_003() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + all timer.stop; + if (t_timer[0].read!=0.0 or t_timer[1].read!=0.0){ + setverdict(fail); + } + setverdict(pass); + + } + control{ + + execute(TC_Sem_2303_timer_stop_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_004.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc26bfbc7e98a3892570eee921ed09943fd018c7 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Sem_2303_timer_stop_004.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure can be stopped after timeout + ** @verdict pass accept, ttcn3verdict:none + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Stopping inactive timer is ok, but unobservable + + +module Sem_2303_timer_stop_004 { + type component TComp{ + timer t_timer := 1.0; + } + altstep a_step() runs on TComp{ + []t_timer.timeout{ + t_timer.stop; + } + } + testcase TC_Sem_2303_timer_stop_004() runs on TComp{ + t_timer.start; + a_step(); + + } + control{ + + execute(TC_Sem_2303_timer_stop_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_006.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4f6967111bb03a1c8222f0d38e208495473ab71 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_006.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure timer stop syntax + ** @verdict pass accept, noexecution + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax + +module Syn_2303_timer_stop_006 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Syn_2303_timer_stop_006() runs on TComp{ + t_timer.start; + t_timer.stop; + setverdict(pass); + } + control{ + + execute(TC_Syn_2303_timer_stop_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_007.ttcn b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f530177fb4562cccd94904e5918ab5fd562bd8f --- /dev/null +++ b/ATS/core_language/23_timer_operations/2303_the_stop_timer_operation/Syn_2303_timer_stop_007.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.3, Ensure all timer stop syntax + ** @verdict pass accept, noexecution + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.3 The Stop timer operation/Timer stop syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow all timer.stop + +module Syn_2303_timer_stop_007 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Syn_2303_timer_stop_007() runs on TComp{ + t_timer.start; + all timer.stop; + setverdict(pass); + + } + control{ + + execute(TC_Syn_2303_timer_stop_007()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_001.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b0f9038aaa31516afe1b8bd3e6d781d60113223 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Timer Read syntax + + +module NegSyn_2304_timer_read_001 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2304_timer_read_001() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + t_timer[].read; + + } + control{ + + execute(TC_NegSyn_2304_timer_read_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_002.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7633611cd3b072b3fa8b47c18116493e0266c45 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Timer Read syntax + + +module NegSyn_2304_timer_read_002 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2304_timer_read_002() runs on TComp{ + var float v_float; + v_float := t_timer read; + + } + control{ + + execute(TC_NegSyn_2304_timer_read_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_003.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c2ce2fabfcc974596327bbcc340a25c395a71bf --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Timer Read syntax + + +module NegSyn_2304_timer_read_003 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2304_timer_read_003() runs on TComp{ + var float v_float; + v_float := read(t_timer); + + } + control{ + + execute(TC_NegSyn_2304_timer_read_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_004.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e7d94476d3f0e91e4246f655fb597104c80a525 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read syntax: disallow any timer.read + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Timer Read syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow any timer.read + +module NegSyn_2304_timer_read_004 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2304_timer_read_004() runs on TComp{ + var float v_float; + v_float := any timer.read; + log ("any timer.read", v_float); + } + control{ + + execute(TC_NegSyn_2304_timer_read_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_005.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26cbe571f41f3ebfb4c16ca797bd2d197be3e421 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/NegSyn_2304_timer_read_005.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Timer Read syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow all timer.read + +module NegSyn_2305_timer_read_005 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2305_timer_read_005() runs on TComp{ + var float v_float; + v_float := all timer.read; + } + control{ + + execute(TC_NegSyn_2305_timer_read_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_001.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52f2e116d0a35008a35a8c9fc9dc385738c68c1b --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read result of inactive timer is zero + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Read on an inactive timer returns float zero + + +module Sem_2304_timer_read_001 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Sem_2304_timer_read_001() runs on TComp{ + if (t_timer.read!=0.0){ + setverdict(fail); + stop; + } + t_timer.start; + t_timer.stop; + if (t_timer.read!=0.0){ + setverdict(fail); + } else { + setverdict(pass); + } + + } + control{ + execute(TC_Sem_2304_timer_read_001()) + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_002.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26908a77f49653c6843d42de78735ce08f1faa2e --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read result is non-negative float + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Read returns elapsed time that is non-neg float + + +module Sem_2304_timer_read_002 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Sem_2304_timer_read_002() runs on TComp{ + var float f:=0.0; + t_timer.start; + f:=t_timer.read; + if (f < 0.0){ + setverdict(fail); + } else { + setverdict(pass); + } + } + control{ + + execute(TC_Sem_2304_timer_read_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_003.ttcn b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d959afcbaf6b21711bc8c31a32088b76013f1be3 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2304_the_read_timer_operation/Sem_2304_timer_read_003.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.4, Ensure timer read result is non-negative float + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.4 The Read timer operation/Read returns elapsed time that is non-neg float + + +module Sem_2304_timer_read_003 { + type component TComp{ + timer t_aux := 1.0; + timer t_aux2 := 1.05; + timer t_timer := 20.0; + } + testcase TC_Sem_2304_timer_read_003() runs on TComp{ + var float v_elapsed; + + t_aux2.start; + + t_timer.start; + + // wait for 1 second + t_aux.start; + t_aux.timeout; + + v_elapsed:=t_timer.read; + if (v_elapsed < 1.0){ + setverdict(fail); + } else { + setverdict(pass); + } + if (t_aux2.running) { + if (v_elapsed <= 1.05) { + setverdict(pass); + } else { + setverdict(fail); + } + } + } + control{ + + execute(TC_Sem_2304_timer_read_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_001.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08ecbeba39fb0a04c134db953c54ccf1c2d7cd5a --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + + +module NegSyn_2305_timer_running_001 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2305_timer_running_001() runs on TComp{ + var boolean v_bool; + v_bool := t_timer running; + } + control{ + + execute(TC_NegSyn_2305_timer_running_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_002.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cc8aec5245e056462db6870fde92a6484f734d6 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + + +module NegSyn_2305_timer_running_002 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2305_timer_running_002() runs on TComp{ + var boolean v_bool; + v_bool := t_timer[].running; + + } + control{ + + execute(TC_NegSyn_2305_timer_running_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_003.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8bc064c327471433a6de540a27500ae8508ea61 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + + +module NegSyn_2305_timer_running_003 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2305_timer_running_003() runs on TComp{ + var boolean v_bool; + v_bool := any timer running; + + } + control{ + + execute(TC_NegSyn_2305_timer_running_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_004.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fc957e1996dee41bd3a3adced5b66a640204c74 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_004.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + + +module NegSyn_2305_timer_running_004 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2305_timer_running_004() runs on TComp{ + var boolean v_bool; + v_bool := timer.running; + + } + control{ + + execute(TC_NegSyn_2305_timer_running_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_005.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf19a96fedda617ca8edff18dfbf7b38c6d950b5 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + + +module NegSyn_2305_timer_running_005 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2305_timer_running_005() runs on TComp{ + var boolean v_bool; + v_bool := timer any.running; + + } + control{ + + execute(TC_NegSyn_2305_timer_running_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_006.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38ff5079cd046db2385699390f84feabcde29385 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/NegSyn_2305_timer_running_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running syntax: disallow all timer.running + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow all timer.running + +module NegSyn_2305_timer_running_006 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2305_timer_running_006() runs on TComp{ + var boolean v_bool; + v_bool := all timer.running; + + } + control{ + + execute(TC_NegSyn_2305_timer_running_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_001.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e858216eaf9780899e3e9818ad880a9721bf737a --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_001.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running any timer identifier works + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/The any keyword may be used to check if any timer started on a component or module control is running + + +module Sem_2305_timer_running_001 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_Sem_2305_timer_running_001() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + all timer.stop; + if (any timer.running){ + setverdict(fail); + stop; + } + setverdict(pass); + + } + control{ + + execute(TC_Sem_2305_timer_running_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_002.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32f4f52414fd0d0d16095764ade3a49ca6188711 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running operation works + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/The operation returns the value true if the timer is listed on the running list, false otherwise. + + +module Sem_2305_timer_running_002 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Sem_2305_timer_running_002() runs on TComp{ + t_timer.start; + if (t_timer.running){ + setverdict(pass); + } else { + setverdict(fail); + } + } + control{ + execute(TC_Sem_2305_timer_running_002()) + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_003.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa4567dd3de0908af013a3497a11e049aa89d2bc --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_003.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running operation works + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/The operation returns the value true if the timer is listed on the running list, false otherwise. + + +module Sem_2305_timer_running_003 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_Sem_2305_timer_running_003() runs on TComp{ + t_timer.start; + t_timer.stop; + if (t_timer.running){ + setverdict(fail); + } else { + setverdict(pass); + } + } + control{ + execute(TC_Sem_2305_timer_running_003()) + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_004.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c97880dd1c07a23338fc02a0ea1cd0a6946787ff --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_004.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer running operation works + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/The operation returns the value true if the timer is listed on the running list, false otherwise. +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow any timer.running + +module Sem_2305_timer_running_004 { + type component TComp{ + timer t_timer := 5.0; + } + testcase TC_Sem_2305_timer_running_004() runs on TComp{ + t_timer.start; + if (any timer.running){ + setverdict(pass); + } else { + setverdict(fail, "no timer running"); + } + t_timer.stop; + } + control{ + execute(TC_Sem_2305_timer_running_004()) + } +} diff --git a/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_005.ttcn b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5350f7960df4ba4cc83c0c6baec66a414950ccdd --- /dev/null +++ b/ATS/core_language/23_timer_operations/2305_the_running_timer_operation/Sem_2305_timer_running_005.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure that correct number of timers from a timer array is still running + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2305_timer_running_005 { + type component TComp { + timer t_TimerArray[2][2] :={{3.0,3.0}, {5.0,5.0}}; + } + testcase TC_Sem_2305_timer_running_005() runs on TComp { + + var integer v_foundIndex[2]; + for (var integer i := 0; i < lengthof(t_TimerArray); i := i + 1) { + for (var integer j := 0; j < lengthof(t_TimerArray[i]); j := j + 1) { + t_TimerArray[i][j].start; + } + } + t_TimerArray[0][0].stop; + if (any from t_TimerArray.running -> @index value v_foundIndex and v_foundIndex[0] == 0 and v_foundIndex[1] == 1) { + setverdict(pass); + } else { + setverdict(fail, "wrong number of timers running"); + } + } + + control { + execute(TC_Sem_2305_timer_running_005()) + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_001.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..09a35fd42156fd9a70cc1ce57d55df9fd8db318c --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax + + +module NegSyn_2306_timer_timeout_001 { + type component TComp{ + timer t_timer[2] := {1.0, 1.0}; + } + testcase TC_NegSyn_2306_timer_timeout_001() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + t_timer[].timeout; + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_002.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a23bcf42ab3d2772a6bf0120bd40f862927a0e65 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout can`t be used in boolean expressions + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The timeout shall not be used in a boolean expression. + + +module NegSyn_2306_timer_timeout_002 { + type component TComp{ + timer t_timer[2] := {1.0, 1.1}; + } + + testcase TC_NegSyn_2306_timer_timeout_002() runs on TComp{ + t_timer[0].start; + if (t_timer[0].timeout){ + setverdict(fail); + } + setverdict(pass); + + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_003.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a61c372da6a86aa89d73016d1da79dc5c7086858 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_003.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax + + +module NegSyn_2306_timer_timeout_003 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2306_timer_timeout_003() runs on TComp{ + t_timer.start; + t_timer.timeout(); + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_004.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d08032310463df0307af3ca2245b2a4092f5a61a --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_004.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax + +module NegSyn_2306_timer_timeout_004 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2306_timer_timeout_004() runs on TComp{ + t_timer.start; + any timer.timeout(); + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_005.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cfb392e7211f8cb3177686bdeadb6f99ad66b20 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax + + +module NegSyn_2306_timer_timeout_005 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2306_timer_timeout_005() runs on TComp{ + t_timer.start; + any timer timeout; + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_006.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52c6eafb625d8f28babb95185e08d3d351fa26ff --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_006.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax + + +module NegSyn_2306_timer_timeout_006 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2306_timer_timeout_006() runs on TComp{ + t_timer.start; + timeout(t_timer); + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_007.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cb6d23e0458d353a6bd1518346961e651d413ab3 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/NegSyn_2306_timer_timeout_007.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout syntax + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timer Timeout syntax +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Disallow all timer.timeout + +module NegSyn_2306_timer_timeout_007 { + type component TComp{ + timer t_timer := 1.0; + } + testcase TC_NegSyn_2306_timer_timeout_006() runs on TComp{ + t_timer.start; + all timer.timeout; + + } + control{ + + execute(TC_NegSyn_2306_timer_timeout_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_001.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff016a5eca9487732de7c92816b5043c310337d7 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout operations: non-started timer does not timeout + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timeout operational semantics/Timeout unstarted timer + + +module Sem_2306_timer_timeout_001 { + type component TComp{ + timer t_unstarted_timer; + timer t_started_timer := 2.0; + } + testcase TC_Sem_2306_timer_timeout_001() runs on TComp{ + t_started_timer.start; + alt + { + [] t_unstarted_timer.timeout { + setverdict(fail); + } + [] t_started_timer.timeout { + setverdict(pass); + } + } + } + control{ + + execute(TC_Sem_2306_timer_timeout_001()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_002.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4cc140eabef6b3a4b118a207087e3b6d6a498954 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_002.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout operations: timed-out timer does not timeout until restarted + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timeout operational semantics/Timeout a timer that is already timed out + + +module Sem_2306_timer_timeout_002 { + type component TComp{ + timer t_timedout_timer := 0.5; + timer t_aux := 2.0; + } + testcase TC_Sem_2306_timer_timeout_002() runs on TComp{ + t_timedout_timer.start; + t_timedout_timer.timeout ; + + t_aux.start; + alt + { + [] t_timedout_timer.timeout { + setverdict(fail); + } + [] t_aux.timeout { + setverdict(pass); + } + } + } + control{ + + execute(TC_Sem_2306_timer_timeout_002()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_003.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33bcd563570b6e1bef6696cb06a1289f5c556bf8 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_003.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout happen in order from the shortest to the longest + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/Timeout operational semantics/Timeout started timer +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The timeout can be used as alternative in alt + +module Sem_2306_timer_timeout_003 { + type component TComp{ + timer t_short, t_medium, t_long; + } + testcase TC_Sem_2306_timer_timeout_003() runs on TComp{ + t_long.start(3.0); + t_medium.start(2.0); + t_short.start(1.0); + + alt + { + [] t_long.timeout { + setverdict(fail, + "Timer started for 3 seconds expired earlier than the timer started for 1 second"); + stop; + } + [] t_medium.timeout { + setverdict(fail, + "Timer started for 2 seconds expired earlier than the timer started for 1 second"); + stop; + } + [] t_short.timeout { + setverdict(pass); + } + } + alt + { + [] t_long.timeout { + setverdict(fail, + "Timer started for 3 seconds expired earlier than the timer started for 2 second"); + stop; + } + [] t_medium.timeout { + setverdict(pass); + } + } + t_long.timeout; + } + control{ + + execute(TC_Sem_2306_timer_timeout_003()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_004.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb814b7417831e5a84c2986a90155108af460fa9 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure any timer.timeout operation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation//Requirements/23 Timer operations/23.6 The Timeout operation/The any keyword used with the timeout operation succeeds if the timeout-list is not empty./Wait for timers in scope of the alt +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The any keyword used with the timeout operation succeeds if the timeout-list is not empty./Wait for timers in scope of the alt +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow any timer.timeout + + +module Sem_2306_timer_timeout_004 { + type component TComp{ + timer t_timer[2] := {1.0, 1.1}; + } + altstep a_step() runs on TComp{ + [] any timer.timeout { + setverdict(pass); + } + } + testcase TC_Sem_2306_timer_timeout_004() runs on TComp{ + t_timer[0].start; + t_timer[1].start; + a_step(); + a_step(); + if (t_timer[0].running or t_timer[1].running){ + setverdict(fail); + } + setverdict(pass); + } + control{ + + execute(TC_Sem_2306_timer_timeout_004()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_005.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d3cd22b8a26e76fcc76c58255f412acfc1347711 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_005.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure any timer.timeout operation for timeouts that are not in scope + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The any keyword used with the timeout operation succeeds if the timeout-list is not empty./Any timer ignores timeouts in other components +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow any timer.timeout + +module Sem_2306_timer_timeout_005 { + const float PTC_TIMEOUT := 1.0; + + type port MyPort message { inout charstring }; + + type component System {} + + type component MTC { + port MyPort signalPort; + } + + type component PTC { + port MyPort signalPort; + } + function f_wait_for_mtc_timeout() runs on PTC + { + timer t_timer := PTC_TIMEOUT; + t_timer.start; + + alt { + [] signalPort.receive { + // any timer.timeout happend in MTC + setverdict(fail, "MTC detected timeout happened in PTC -- it is wrong!"); + } + [] t_timer.timeout { + setverdict(pass); + signalPort.send("I'm timed out!"); + } + } + } + + altstep a_step() runs on MTC { + [] any timer.timeout { + setverdict(fail, "MTC detected timeout happened in PTC -- it is wrong!"); + signalPort.send("I saw your timeout?"); + } + [] signalPort.receive { + // PTC timer out + setverdict(pass); + } + } + + testcase TC_Sem_2306_timer_timeout_005() runs on MTC system System{ + var PTC ptc := PTC.create; + connect(ptc:signalPort, mtc:signalPort); + ptc.start(f_wait_for_mtc_timeout()); + + a_step(); + } + control{ + + execute(TC_Sem_2306_timer_timeout_005()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_006.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b9e46f112b8a561f1fb0e26e87681d0e247886e --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_006.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure any timer.timeout operation handles timeout of any timer in the component, not only visible from a function or altstep + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The any keyword used with the timeout operation succeeds if the timeout-list is not empty./Wait for timers that are outside of scope +// #reqname /Requirements/23 Timer operations/23.7 Summary of use of any and all with timers/Allow any timer.timeout + +module Sem_2306_timer_timeout_006 { + const float PTC_TIMEOUT := 5.0; + + type port MyPort message { inout charstring }; + + type component System {} + + type component MTC { + port MyPort signalPort; + } + + type component PTC { + port MyPort signalPort; + } + function f_ptc1() runs on PTC + { + timer t_timer := PTC_TIMEOUT; + t_timer.start; + + t_timer.timeout; + setverdict(fail, "The component was expected to be killed before this point"); + signalPort.send("I'm timed out!"); + } + + altstep a_step() runs on MTC { + [] any timer.timeout { + setverdict(pass); + } + [] signalPort.receive { + // PTC timer out + setverdict(fail, "Any timer.timeout failed to see the timer outside altstep scope"); + } + } + + testcase TC_Sem_2306_timer_timeout_006() runs on MTC system System{ + var PTC ptc := PTC.create; + timer t_timer; + connect(ptc:signalPort, mtc:signalPort); + ptc.start(f_ptc1()); + + // Start a timer outside of the scope of a_step + t_timer.start(1.0); + a_step(); + ptc.kill; + } + control{ + + execute(TC_Sem_2306_timer_timeout_006()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_007.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac57ab3e399858698ccd6a9a355212c7bb0815b6 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure timer timeout happen in order from the shortest to the longest + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.6 The Timeout operation/The timeout can be used as a standalone statement + +module Sem_2306_timer_timeout_007 { + type component TComp{ + timer t_short, t_medium, t_long; + } + testcase TC_Sem_2306_timer_timeout_007() runs on TComp{ + t_long.start(3.0); + t_medium.start(2.0); + t_short.start(1.0); + + t_medium.timeout; + if (t_short.running) + { + setverdict(fail, "The timer has expired too early"); + stop; + } + if (not t_long.running) + { + setverdict(fail, "The timer has expired too late"); + stop; + } + setverdict(pass); + } + control{ + + execute(TC_Sem_2306_timer_timeout_007()) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_008.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eec5bc302f3b1c281a51fc4b7c0151e2e629eae5 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_008.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470, corrected by STF 487 + ** @version 0.0.1 + ** @purpose 1:23.6, Ensure that timeout of a timer from a timer array works correctly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2306_timer_timeout_008 { + type component TComp{ + timer t_TimerArray[2][2] :={{0.5, 1.0}, {5.0, 5.5}}; + } + testcase TC_Sem_2306_timer_timeout_008() runs on TComp{ + var integer v_foundIndex[2]; + for (var integer i := 0; i < lengthof(t_TimerArray); i := i + 1) { + for (var integer j := 0; j < lengthof(t_TimerArray[i]); j := j + 1) { + t_TimerArray[i][j].start; + } + } + t_TimerArray[0][0].stop; + + any from t_TimerArray.timeout -> @index value v_foundIndex; + if(v_foundIndex[0] == 0 and v_foundIndex[1] == 1){ + setverdict(pass); + } else { + setverdict(fail, "wrong number of timers with timeout"); + } + + } + control{ + + execute(TC_Sem_2306_timer_timeout_008(), 5.0) + + + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_009.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..01c753427c2756914690ae1a0c302d56e9947070 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Sem_2306_timer_timeout_009.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:23.6, removing random timeout when using any timer.timeout + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2306_timer_timeout_009 { + + type component TComp{ + timer t_tmr := 0.5; + } + + testcase TC_Sem_2306_timer_timeout_009() runs on TComp{ + t_tmr.start; + any timer.timeout; // it should remove t_tmr timeout from the timeout table + alt { + [] t_tmr.timeout { setverdict(fail, "Timeout not removed by any timer.timeout"); } + [else] { setverdict(pass); } + } + } + + control { + execute(TC_Sem_2306_timer_timeout_009(), 5.0) + } +} diff --git a/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Syn_2306_timer_timeout_001.ttcn b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Syn_2306_timer_timeout_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52e1e6cc607c1c3b457aa5bae7c0748699eae859 --- /dev/null +++ b/ATS/core_language/23_timer_operations/2306_the_timeout_operation/Syn_2306_timer_timeout_001.ttcn @@ -0,0 +1,42 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23.5, Ensure timer runnig syntax + ** @verdict pass accept, noexecution + ***************************************************/ +// #reqname /Requirements/23 Timer operations/23.5 The Running timer operation/Timer running syntax + +module Syn_2306_timer_timeout_001 +{ + type component TComp {} + + testcase TC_Syn_2306_timer_timeout_001() runs on TComp + { + var boolean v_bool; + timer t_timer := 0.1; + timer t_array[3] := { 1.0, 2.0, 3.0 } + + t_timer.start; + if (t_timer.running) + { + t_array[0].start; + if (t_array[0].running) + { + v_bool := t_array[1].running; + } + } + + v_bool := any timer.running; + if (any timer.running and true) + { + } + if (not any timer.running) + { + } + } + + control{ + execute(TC_Syn_2306_timer_timeout_001()) + } + +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_001.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62233bc1a00f9f9552cc6829013fd097ad5e3970 --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_001.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer operations are not allowed outside of module control, test case, function, altstep + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Timer read is not allowed in component definitions +module NegSem_23_toplevel_001 +{ + type component TComp + { + timer t_timer1 := 1.0; + timer t_timer2 := t_timer1.read; + } + + testcase TC_NegSem_23_toplevel_001() runs on TComp + { + log("Value of t_timer2.read before starting it", t_timer2.read); + } + + control + { + execute(TC_NegSem_23_toplevel_001()) + } +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_002.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d29edffb084acf0b98aedc419f867b085090150c --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/NegSem_23_toplevel_002.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer operations are not allowed outside of module control, test case, function, altstep + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Timer running is not allowed in component definitions +module NegSem_23_toplevel_002 +{ + type component TComp + { + timer t_timer1 := 1.0; + var boolean v_bool := t_timer1.running; + } + + testcase TC_NegSem_23_toplevel_002() runs on TComp + { + log("Value of timer.running before starting it", v_bool); + } + + control + { + execute(TC_NegSem_23_toplevel_002()) + } +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_001.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9ff619c084f245b2a1f6ba5450d707dbb7c57fd --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_001.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer operations are not allowed outside of module control, test case, function, altstep + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Timer stop is not allowed in module definitions + +module NegSyn_23_toplevel_001 +{ + all timer.stop; +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_002.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9039ca22747c89cbeeca142b74770c704ba919a6 --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/NegSyn_23_toplevel_002.ttcn @@ -0,0 +1,12 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer operations are not allowed outside of module control, test case, function, altstep + ** @verdict pass reject + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Timer timeout operation is not allowed in module definitions + +module NegSyn_23_toplevel_002 +{ + any timer.timeout; +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_001.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dad5d1b81234f443325e1b51cbe10004424d9d7a --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_001.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer allowed in module control, test case, function, altstep + ** @verdict pass accept, noexecution + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Positive syntax test + +module Syn_23_toplevel_001 +{ + type port MyPort message + { + inout integer; + } + + type component TComp + { + port MyPort p_port; + } + + function f_function() + { + var float v_float; + timer t_timer; + + t_timer.start(1.0); + v_float := t_timer.read; + if (t_timer.running) + { + t_timer.timeout; + } + t_timer.stop; + } + + altstep a_step() runs on TComp + { + [] p_port.receive { + var float v_float; + timer t_timer; + + t_timer.start(1.0); + v_float := t_timer.read; + if (t_timer.running) + { + t_timer.timeout; + } + t_timer.stop; + } + } + + testcase TC_Syn_23_toplevel_001() runs on TComp + { + var float v_float; + timer t_timer; + + t_timer.start(1.0); + v_float := t_timer.read; + if (t_timer.running) + { + t_timer.timeout; + } + t_timer.stop; + } + + control + { + var float v_float; + timer t_timer; + + t_timer.start(1.0); + v_float := t_timer.read; + if (t_timer.running) + { + t_timer.timeout; + } + t_timer.stop; + } +} diff --git a/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_002.ttcn b/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..165350c4d60c3bd8e4ceba48634e7a5a42ad273a --- /dev/null +++ b/ATS/core_language/23_timer_operations/23_toplevel/Syn_23_toplevel_002.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:23, Ensure timer allowed in module control, test case, function, altstep + ** @verdict pass accept, noexecution + ***************************************************/ +// #reqname /Requirements/23 Timer operations/Usage of timers is allowed in test cases, functions, altsteps, module control/Positive syntax test + +module Syn_23_toplevel_002 +{ + type port MyPort message + { + inout integer; + } + + type component TComp + { + port MyPort p_port; + } + + function f_function() + { + var float v_float; + timer t_timer[5] := {1.0, 2.0, 3.0, 4.0, 5.0}; + + t_timer[0].start(1.0); + v_float := t_timer[1].read; + if (t_timer[2].running) + { + t_timer[3].timeout; + } + t_timer[4].stop; + } + + altstep a_step() runs on TComp + { + timer t_timer[5] := {1.0, 2.0, 3.0, 4.0, 5.0}; + [] p_port.receive { + var float v_float; + + t_timer[0].start(1.0); + v_float := t_timer[1].read; + if (t_timer[2].running) + { + t_timer[3].timeout; + } + t_timer[4].stop; + } + } + + testcase TC_Syn_23_toplevel_002() runs on TComp + { + var float v_float; + timer t_timer[5] := {1.0, 2.0, 3.0, 4.0, 5.0}; + + t_timer[0].start(1.0); + v_float := t_timer[1].read; + if (t_timer[2].running) + { + t_timer[3].timeout; + } + t_timer[4].stop; + } + + control + { + var float v_float; + timer t_timer[5] := {1.0, 2.0, 3.0, 4.0, 5.0}; + + t_timer[0].start(1.0); + v_float := t_timer[1].read; + if (t_timer[2].running) + { + t_timer[3].timeout; + } + t_timer[4].stop; + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NOTES b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..05f826b28ac165b00e4577da5ac78f9e89164990 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NOTES @@ -0,0 +1,11 @@ +Tests Sem_2401_GlobalVerdict_xxx validate the following requirements: + there is a global test case verdict instantiated and handled by the test system that is + updated when each test component (i.e. the MTC and each and every PTC) + terminates execution (see figure 14). + ... The test case verdict is implicitly updated on the termination of a test + component. The effect of this implicit operation shall also follow the overwriting rules listed in table 30 + ... The value of this verdict shall be returned by the test case when it terminates execution. + +Tests Sem_2401_LocalVerdict_xxx validate the following requirements: + When changing the value of the local verdict (i.e. using the setverdict operation) the effect of this change shall + follow the overwriting rules listed in table 30. diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NegSem_2401_SetverdictError.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NegSem_2401_SetverdictError.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e0fa9b62ab2612a985345f03f82114c0be0d205 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/NegSem_2401_SetverdictError.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.1, Ensure that setverdict can't set error verdict + ** @verdict pass reject, manual:"Ensure only one test case was executed " + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Error verdict shall not be set with setverdict + **/ + +module NegSem_2401_SetverdictError_001 { + type component GeneralComp {}; + + testcase TC_NegSem_2401_SetverdictError_001_setverdict(out boolean pb_error_occurred) runs on GeneralComp { + pb_error_occurred := true; + setverdict(error); + // Must abort here + pb_error_occurred := false; + setverdict(pass) + } + + testcase TC_NegSem_2401_SetverdictError_001_check_error_occured(boolean b_error_occurred) runs on GeneralComp { + if (b_error_occurred) { + setverdict(pass); + } else { + setverdict(fail) + } + } + + control { + var boolean b_error_occurred := true; + execute(TC_NegSem_2401_SetverdictError_001_setverdict(b_error_occurred)); + execute(TC_NegSem_2401_SetverdictError_001_check_error_occured(b_error_occurred)); + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_001.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32c4c736922c135699472919c28cc25517447708 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_001.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: pass can overwrite none. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_001 { + type component GeneralComp {} + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_2401_GlobalVerdict_001() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_none()); + PTC2.start(set_PTC_verdict_pass()); + all component.done; + // Verdict pass can overwrite none + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_001()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_002.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cc560f8f6c0f849d64bcb28902415fc411f94e67 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: inconc can overwrite none. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_002 { + type component GeneralComp {} + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + testcase TC_Sem_2401_GlobalVerdict_002() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_none()); + PTC2.start(set_PTC_verdict_inconc()); + all component.done; + // Verdict inconc can overwrite none + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_002()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_003.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..66fbf2289f3f3006bf53a62b9bccb55cb01fb523 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_003.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: fail can overwrite none. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_003 { + type component GeneralComp {} + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + testcase TC_Sem_2401_GlobalVerdict_003() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_none()); + PTC2.start(set_PTC_verdict_fail()); + all component.done; + // Verdict fail can overwrite none + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_003()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_004.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..05b7771e8b073360e5b5ecb25457634a85987715 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: none can't overwrite pass. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_004 { + type component GeneralComp {} + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + testcase TC_Sem_2401_GlobalVerdict_004() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_pass()); + PTC2.start(set_PTC_verdict_none()); + all component.done; + // Verdict none can't overwrite pass + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_004()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_005.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20ffbd272c4b21d8acfb8a725fde0e5caff7687d --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: inconc can overwrite pass. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_005 { + type component GeneralComp {} + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + testcase TC_Sem_2401_GlobalVerdict_005() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_pass()); + PTC2.start(set_PTC_verdict_inconc()); + all component.done; + // Verdict inconc can overwrite pass + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_005()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_006.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b881eb1aaa826b0b856093e9c090adfeafa78901 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: fail can overwrite pass. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_006 { + type component GeneralComp {} + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + testcase TC_Sem_2401_GlobalVerdict_006() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_pass()); + PTC2.start(set_PTC_verdict_fail()); + all component.done; + // Verdict fail can overwrite pass + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_006()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_007.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07ce5a598467b668892a99144b0eebeada9a5bcc --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: none can't overwrite inconc. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_007 { + type component GeneralComp {} + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + testcase TC_Sem_2401_GlobalVerdict_007() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_inconc()); + PTC2.start(set_PTC_verdict_none()); + all component.done; + // Verdict none can't overwrite inconc + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_007()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_008.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b492ddc0e1ea8f74a100bd3c3c5860235f452f36 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: pass can't overwrite inconc. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_008 { + type component GeneralComp {} + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_2401_GlobalVerdict_008() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_inconc()); + PTC2.start(set_PTC_verdict_pass()); + all component.done; + // Verdict pass can't overwrite inconc + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_008()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_009.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42b8924a4a0229d8167dc3a90e093b24a8f59bf2 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: fail can overwrite inconc. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_009 { + type component GeneralComp {} + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + testcase TC_Sem_2401_GlobalVerdict_009() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_inconc()); + PTC2.start(set_PTC_verdict_fail()); + all component.done; + // Verdict fail can overwrite inconc + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_009()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_010.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..759166ee3a908de0f09057063726a6b627283a2a --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_010.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: none can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_010 { + type component GeneralComp {} + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + function set_PTC_verdict_none() runs on GeneralComp { + setverdict(none); + } + + testcase TC_Sem_2401_GlobalVerdict_010() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_fail()); + PTC2.start(set_PTC_verdict_none()); + all component.done; + // Verdict none can't overwrite fail + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_010()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_011.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..337a7a63427ecf733391dc2c8c3f1a5b1a6a0f7e --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_011.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: pass can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_011 { + type component GeneralComp {} + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + function set_PTC_verdict_pass() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_2401_GlobalVerdict_011() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_fail()); + PTC2.start(set_PTC_verdict_pass()); + all component.done; + // Verdict pass can't overwrite fail + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_011()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_012.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f8f5907cfd2d4af7c6f50d77912da3c5125b868 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_GlobalVerdict_012.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for global verdict: inconc can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ + + +module Sem_2401_GlobalVerdict_012 { + type component GeneralComp {} + + function set_PTC_verdict_fail() runs on GeneralComp { + setverdict(fail); + } + + function set_PTC_verdict_inconc() runs on GeneralComp { + setverdict(inconc); + } + + testcase TC_Sem_2401_GlobalVerdict_012() runs on GeneralComp system GeneralComp { + var GeneralComp PTC1, PTC2; + + PTC1 := GeneralComp.create; + PTC2 := GeneralComp.create; + PTC1.start(set_PTC_verdict_fail()); + PTC2.start(set_PTC_verdict_inconc()); + all component.done; + // Verdict inconc can't overwrite fail + } + + control{ + execute(TC_Sem_2401_GlobalVerdict_012()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_InitiallyNone_001.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_InitiallyNone_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..423d902c9bbed150f68bfa7185cb3309d9e8dd1c --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_InitiallyNone_001.ttcn @@ -0,0 +1,27 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.1, Ensure that local verdicts initializes with none + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Local verdict is initialized with none + **/ + + +module Sem_2401_InitiallyNone_001 { + type component GeneralComp {} + + testcase TC_Sem_2401_InitiallyNone_001() runs on GeneralComp { + var verdicttype b_verdict := getverdict; + if (b_verdict == none) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_2401_InitiallyNone_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_001.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f3ee6159183b60773134b17987b47515b1f50fa --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_001.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: pass can overwrite none. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_001 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_001() runs on GeneralComp { + setverdict(none); + setverdict(pass); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_001()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_002.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f38b79ae5d407146291671a18133503f205ee59 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: inconc can overwrite none. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_002 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_002() runs on GeneralComp { + setverdict(none); + setverdict(inconc); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_002()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_003.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd02658d4f7ee24fa28a2e3def9ab692900d02c4 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_003.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: fail can overwrite none. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_003 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_003() runs on GeneralComp { + setverdict(none); + setverdict(fail); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_003()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_004.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ea8c7afff03727e03e4866027709882c8a5b013 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: none can't overwrite pass. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_004 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_004() runs on GeneralComp { + setverdict(pass); + setverdict(none); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_004()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_005.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2132edf96a6536ec8a6e32b700887490eaba4d14 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_005.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: inconc can overwrite pass. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_005 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_005() runs on GeneralComp { + setverdict(pass); + setverdict(inconc); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_005()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_006.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..842de3c03030824a9b68289c3940e2b6e1678be8 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_006.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: fail can overwrite pass. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_006 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_006() runs on GeneralComp { + setverdict(pass); + setverdict(fail); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_006()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_007.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..364cc7fc600c080e81c8c65a841abc8c49750fe8 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_007.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: none can't overwrite inconc. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_007 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_007() runs on GeneralComp { + setverdict(inconc); + setverdict(none); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_007()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_008.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba591ad11a0f93c71783783002fa6ea7a47af9da --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_008.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: pass can't overwrite inconc. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_008 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_008() runs on GeneralComp { + setverdict(inconc); + setverdict(pass); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_008()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_009.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a30f0fd2d80c9f0def9a76ff8f5cc85365dbba9b --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_009.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: fail can overwrite inconc. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_009 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_009() runs on GeneralComp { + setverdict(inconc); + setverdict(fail); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_009()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_010.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c3fd220fed97215c7a0f6cf406fa2fa91af327b3 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_010.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: none can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_010 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_010() runs on GeneralComp { + setverdict(fail); + setverdict(none); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_010()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_011.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c02b0154aed0fa9dbdafa42443de690e92b281b6 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_011.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: pass can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_011 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_011() runs on GeneralComp { + setverdict(fail); + setverdict(pass); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_011()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_012.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19e4f943b7d25f37b09afaec4bccf0ab2f09d0ce --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Sem_2401_LocalVerdict_012.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.1, Ensure overwriting rules for local verdict: inconc can't overwrite fail. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Overwriting rules for setverdict + **/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/The value of the local verdict is changed with the setverdict operation. + **/ + + +module Sem_2401_LocalVerdict_012 { + type component GeneralComp {} + + testcase TC_Sem_2401_LocalVerdict_012() runs on GeneralComp { + setverdict(fail); + setverdict(inconc); + + // The verdict is evaluated by the validation tool according to @verdict header + } + + control{ + execute(TC_Sem_2401_LocalVerdict_012()); + } +} diff --git a/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Syn_2401_FiveValues_001.ttcn b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Syn_2401_FiveValues_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54cc78e0614be0cfedffef46ee1504dd19ea2fd0 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2401_the_verdict_mechanism/Syn_2401_FiveValues_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.1, Ensure that there are five values of verdicttype + ** @verdict pass accept, noexecution + *****************************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.1 The Verdict mechanism/Five different values of verdict + **/ + + +module Syn_2401_FiveValues_001 { + control { + var verdicttype v_v; + + v_v := none; + v_v := pass; + v_v := inconc; + v_v := fail; + v_v := error; + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_001.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..64ae948001ccb3785c3f4eef2c61c97437039f69 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts parameters of verdicttype only + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Setverdict allowed verdict values + **/ + +module NegSem_2402_setverdict_params_001 { + type component TComp {} + + testcase TC_NegSem_2402_setverdict_params_001() runs on TComp { + var charstring v_pass := "pass"; + setverdict(v_pass); + } + + control { + execute(TC_NegSem_2402_setverdict_params_001()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_002.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fde63e85ef99c639befd9db7349149237cea358 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_002.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts parameters of verdicttype only + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Setverdict allowed verdict values + **/ + + +module NegSem_2402_setverdict_params_002 { + type component TComp {} + type record TRec { verdicttype field1 } + + testcase TC_NegSem_2402_setverdict_params_002() runs on TComp { + var TRec v_pass := { field1 := pass }; + setverdict(v_pass); + } + + control { + execute(TC_NegSem_2402_setverdict_params_002()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_003.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21c95e8b9801d31f8c1876c89ef86b0145669d84 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_003.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:24, Ensure setverdict accepts values of verdicttype only + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Setverdict allowed verdict values + **/ + +module NegSem_2402_setverdict_params_003 { + type component TComp {} + + testcase TC_NegSem_2402_setverdict_params_003() runs on TComp { + var template verdicttype v_pass := ( pass, fail ); + setverdict(v_pass); + } + + control { + execute(TC_NegSem_2402_setverdict_params_003()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_004.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28c09e90a06ecb377fcdd1ffe965a1a78832fc6d --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_004.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts values only as the parameter + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Setverdict allowed verdict values + **/ + +module NegSem_2402_setverdict_params_004 { + type component TComp {} + + testcase TC_NegSem_2402_setverdict_params_004() runs on TComp { + var template verdicttype v_pass := ?; + setverdict(v_pass); + } + + control { + execute(TC_NegSem_2402_setverdict_params_004()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_005.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21923da678c048a80b6c851362ed2391de816f3c --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/NegSem_2402_setverdict_params_005.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts values only as the parameter + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Setverdict allowed verdict values + **/ + +module NegSem_2402_setverdict_params_005 { + type component TComp {} + + testcase TC_NegSem_2402_setverdict_params_005() runs on TComp { + var anytype v_var := { integer := 1 }; + setverdict(v_var.verdicttype); + } + + control { + execute(TC_NegSem_2402_setverdict_params_005()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_logging_001.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_logging_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1675772b82616990236c3a1990ba9b1cfaf66843 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_logging_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure logging constraints + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/For FreeText and TemplateInstance, the same rules and restrictions apply as for the parameters of the log statement. + **/ + +module Sem_2402_setverdict_logging_001 { + type component TComp {} + + testcase TC_Sem_2402_setverdict_logging_001() runs on TComp { + var integer v_uninitialized ; + setverdict(pass, "Uninitialized variable", v_uninitialized); + } + + control { + execute(TC_Sem_2402_setverdict_logging_001()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_001.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6d023f5bad5df64981c1231937c8e6d029f6df4f --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_001.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts values only as the parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Optional setverdict parameters + **/ + +module Sem_2402_setverdict_params_001 { + type component TComp {} + + testcase TC_Sem_2402_setverdict_params_001() runs on TComp { + var anytype v_var := { verdicttype := pass }; + setverdict(v_var.verdicttype); + } + + control { + execute(TC_Sem_2402_setverdict_params_001()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_002.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9044dad89095abfddb97074e3df239fa6035aba6 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_002.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict accepts values only as the parameter + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Optional setverdict parameters + **/ + +module Sem_2402_setverdict_params_002 { + type component TComp {} + + testcase TC_Sem_2402_setverdict_params_002() runs on TComp { + var template verdicttype v_pass := pass; + setverdict(valueof(v_pass)); + } + + control { + execute(TC_Sem_2402_setverdict_params_002()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_003.ttcn b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0b44e93ec7f9f47db1eae163dfcd817cc5e1799 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2402_the_setverdict_operation/Sem_2402_setverdict_params_003.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure logging constraints + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.2 The Setverdict operation/Optional setverdict parameters + **/ + +module Sem_2402_setverdict_params_003 { + type component TComp {} + + testcase TC_Sem_2402_setverdict_params_003() runs on TComp { + var template verdicttype v_pass := pass; + setverdict(valueof(v_pass)); + } + + control { + execute(TC_Sem_2402_setverdict_params_003()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_001.ttcn b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02ef4e676c6d469c8eed07ddfbb71cd2f2dde575 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_001.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.3, Ensure getverdict returns the actual verdict none + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// #reqname /Requirements/24 Test verdict operations/24.3 The Getverdict operation/Getverdict returns local verdict value + +module Sem_2403_getverdict_001 { + type component TComp {} + + testcase TC_Sem_2403_getverdict_001() runs on TComp { + var verdicttype v_verdict; + setverdict(none); + v_verdict := getverdict; + if (v_verdict == none) + { + setverdict(pass) + } + else + { + setverdict(fail); + } + } + + control { + execute(TC_Sem_2403_getverdict_001()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_002.ttcn b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd5c8df87f85571d15799750d7e436f2c0b73f57 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_002.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.3, Ensure getverdict returns the actual verdict inconc + ** @verdict pass accept, ttcn3verdict:inconc + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.3 The Getverdict operation/Getverdict returns local verdict value + **/ + +module Sem_2403_getverdict_002 { + type component TComp {} + + testcase TC_Sem_2403_getverdict_002() runs on TComp { + var verdicttype v_verdict; + setverdict(inconc); + v_verdict := getverdict; + if (v_verdict != inconc) + { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_2403_getverdict_002()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_003.ttcn b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3884861e87e675e871566816ebb46717cbe8f210 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_003.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.3, Ensure getverdict returns the actual verdict pass + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.3 The Getverdict operation/Getverdict returns local verdict value + **/ + +module Sem_2403_getverdict_003 { + type component TComp {} + + testcase TC_Sem_2403_getverdict_003() runs on TComp { + var verdicttype v_verdict; + setverdict(pass); + v_verdict := getverdict; + if (v_verdict == pass) + { + setverdict(pass) + } + else + { + setverdict(fail); + } + } + + control { + execute(TC_Sem_2403_getverdict_003()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_004.ttcn b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a0fc6a7ed0ebd0f3444b4ba6e8e6f483f553566 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_004.ttcn @@ -0,0 +1,28 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24.3, Ensure getverdict returns the actual verdict fail + ** @verdict pass accept, ttcn3verdict:error + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.3 The Getverdict operation/Getverdict returns local verdict value + **/ + +module Sem_2403_getverdict_004 { + type component TComp {} + + testcase TC_Sem_2403_getverdict_004() runs on TComp { + var verdicttype v_verdict; + setverdict(fail); + v_verdict := getverdict; + if (v_verdict == fail) + { + // Set error verdict + testcase.stop; + } + } + + control { + execute(TC_Sem_2403_getverdict_004()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_005.ttcn b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75649ca15b9339f83db814b037cc2a1a7ea1c847 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/2403_the_getverdict_operation/Sem_2403_getverdict_005.ttcn @@ -0,0 +1,31 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24.3, Ensure getverdict none for uninitialized verdict + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/24.3 The Getverdict operation/Getverdict returns local verdict value/Getverdict returns none for uninitialized verdict + **/ + +module Sem_2403_getverdict_005 { + type component TComp {} + + testcase TC_Sem_2403_getverdict_005() runs on TComp { + var verdicttype v_verdict; + v_verdict := getverdict; + if (v_verdict != none) + { + // Set error verdict + testcase.stop; + } + else + { + setverdict(pass); + } + } + + control { + execute(TC_Sem_2403_getverdict_005()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_001.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..47570354850fb6042b6709b03f34db36336805e3 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_001.ttcn @@ -0,0 +1,24 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:24, Ensure getverdict is not allowed in constant initialization in control part + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions. + **/ + +module NegSem_24_toplevel_001 { + // This should be syntactically correct since BNF does not restrict initialization expression + const verdicttype c_verdict := getverdict; + + type component GeneralComp {} + + testcase TC_NegSem_24_toplevel_001 (verdicttype v_verdict) runs on GeneralComp{ + setverdict(pass) + } + + control { + execute(TC_NegSem_24_toplevel_001(c_verdict)); + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_002.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f0ae0acc55e99e387bacabab28bbb82cbe66d58 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_002.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure getverdict is not allowed in parameter initialization in control part. + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions. + **/ + +module NegSem_24_toplevel_002 { + type component GeneralComp {} + + testcase TC_NegSem_24_toplevel_002(verdicttype v_param) runs on GeneralComp { + setverdict(fail); + } + + control { + // BNF allows getverdict in expression -- this is a semantic test + execute(TC_NegSem_24_toplevel_002(getverdict)); + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_003.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e3ee0faaf54e52edad7408f6edffd7513e19a14 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_003.ttcn @@ -0,0 +1,22 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure getverdict is not allowed in variable definition in control part. + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions. + **/ + +module NegSem_24_toplevel_003 { + type component GeneralComp {} + + testcase TC_NegSem_24_toplevel_003(verdicttype v_param) runs on GeneralComp { + setverdict(fail); + } + + control { + var verdicttype v_verdict := getverdict; + execute(TC_NegSem_24_toplevel_003()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_004.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bd215f3985cdedf34eb675e413f5faa64a12404 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_004.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.2 + ** @purpose 1:24, Ensure setverdict is not allowed in part whithin compound statement. + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions. + **/ + +module NegSem_24_toplevel_004 { + type component GeneralComp {} + + testcase TC_NegSem_24_toplevel_004() runs on GeneralComp { + setverdict(fail); + } + + + control { + if (true) { + // It is allowed by BNF: ControlStatement -> BasicStatements -> ConditionalConstruct -> StatementBlock => SetLocalVerdict + setverdict(pass); + } + execute(TC_NegSem_24_toplevel_004()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_005.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5289f691893041e9a5301ad27a4acb7700db0d1a --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/NegSem_24_toplevel_005.ttcn @@ -0,0 +1,25 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.2 + ** @purpose 1:24, Ensure setverdict is not allowed in control part at the top level. + ** @verdict pass reject + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions. + **/ + +module NegSem_24_toplevel_005 { + type component GeneralComp {} + + testcase TC_NegSem_24_toplevel_005() runs on GeneralComp { + setverdict(fail); + } + + + control { + // TODO Check with grammar if it is allowed + // At least grammar allowes it in compound statements + setverdict(pass); + execute(TC_NegSem_24_toplevel_005()) + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_001.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7ba2de0ed578b1b79f7153faac35124cf5d1868 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_001.ttcn @@ -0,0 +1,32 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict and getverdict are allowed in functions + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions./Setverdict locations/Setverdict in functions allowed + **/ + +module Syn_24_toplevel_001 { + function f_test_setverdict() { + setverdict(none); + setverdict(pass); + setverdict(inconc); + setverdict(fail); + } + + function f_test_variable_assignment() { + var verdicttype v_verdict; + + v_verdict := getverdict; + } + + function f_test_return_getverdict() return verdicttype { + return getverdict; + } + + function f_test_const_init() { + const verdicttype c_v := getverdict; + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_002.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7b71ccfe6177872c5d6aed248f1d8adfa6b68770 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_002.ttcn @@ -0,0 +1,30 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict and getverdict are allowed in test cases + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions./Setverdict locations/Setverdict allowed in test cases + **/ + +module Syn_24_toplevel_002 { + type component GeneralComp {}; + + testcase TC_Syn_24_toplevel_002_setverdict() runs on GeneralComp { + setverdict(none); + setverdict(pass); + setverdict(inconc); + setverdict(fail); + } + + testcase TC_Syn_24_toplevel_002_getverdict() runs on GeneralComp { + var verdicttype v_verdict; + + v_verdict := getverdict; + } + + testcase TC_Syn_24_toplevel_002_return_getverdict() runs on GeneralComp { + const verdicttype c_v := getverdict; + } +} \ No newline at end of file diff --git a/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_003.ttcn b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03fdc49768b3312c4e2807d00b28357a9b0c3c76 --- /dev/null +++ b/ATS/core_language/24_test_verdict_operations/24_toplevel/Syn_24_toplevel_003.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:24, Ensure setverdict and getverdict are allowed in atsteps + ** @verdict pass accept, noexecution + ***************************************************/ +/* + * #reqname /Requirements/24 Test verdict operations/Getverdict and setverdict operations shall only be used in test cases, altsteps and functions./Setverdict locations/Setverdict allowed in altsteps + **/ + +module Syn_24_toplevel_003 { + type record MessageType { + integer field + } + + type port MessagePort message { + inout MessageType; + } + + type component GeneralComp { + port MessagePort PCO1; + port MessagePort PCO2; + port MessagePort PCO3; + } + + altstep a_test_get_set_verdict() runs on GeneralComp { + var verdicttype v_verdict := getverdict; + + [] PCO1.receive { + setverdict(pass); + } + [] PCO2.receive { + setverdict(inconc); + } + [] PCO3.receive { + setverdict(fail); + } + } +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_001.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4f5b98d7a43197153b3ae0b54080d9f9066722c --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_001.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that non-float timeout parameters in the execute statement are rejected (in this case int). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2601_ExecuteStatement_001 { + +type component GeneralComp { } + +testcase TC_NegSem_2601_ExecuteStatement_001() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_NegSem_2601_ExecuteStatement_001(), 1); +} + +} diff --git a/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_002.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae85af5087f3996824abb48d8e39f569fe22a76e --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_002.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that non-float timeout parameters in the execute statement are rejected (in this case charstring). + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2601_ExecuteStatement_002 { + +type component GeneralComp { } + +testcase TC_NegSem_2601_ExecuteStatement_002() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_NegSem_2601_ExecuteStatement_002(), "foobar"); +} + +} diff --git a/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_003.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ae72bf7d0e7515291b2ebc6966b9fa73fcdf3f5 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_003.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that host id can be only charstring. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2601_ExecuteStatement_003 { + +type component GeneralComp { } + +testcase TC_NegSem_2601_ExecuteStatement_003(integer p_value, charstring p_string, boolean p_bool) runs on GeneralComp { + setverdict(pass); +} + +control { + var integer v_test := 20; + var octetstring v_host := '4469707379'O; //not allowed host type + execute(TC_NegSem_2601_ExecuteStatement_003(v_test, "hello", true), -, v_host); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_004.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e6dead8f2c7093ff50137d923a9911a120976d3 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/NegSem_2601_ExecuteStatement_004.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that execution rejects test case execution with infinity timer guard + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2601_ExecuteStatement_004 { + +type component GeneralComp { } + +testcase TC_NegSem_2601_ExecuteStatement_004(integer p_value, charstring p_string, boolean p_bool) runs on GeneralComp { + setverdict(pass); +} + +control { + var integer v_test := 20; + execute(TC_NegSem_2601_ExecuteStatement_004(v_test, "hello", true), infinity); //not allowed to explicitly assign infinite timer +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_001.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07ce3fe14fd205498d6c88bd8db1e06526e7e943 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_001.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that parameters are passed correctly into the test case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2601_ExecuteStatement_001 { + +type component GeneralComp { } + +testcase TC_Sem_2601_ExecuteStatement_001(integer p_value) runs on GeneralComp { + if (p_value == 20) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + var integer v_test := 20; + execute(TC_Sem_2601_ExecuteStatement_001(v_test)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_002.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b855f3037487dec6c834ca1eb0f6fec3c9a01e65 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_002.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that multiple parameters of different types are passed correctly into the test case. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2601_ExecuteStatement_002 { + +type component GeneralComp { } + +testcase TC_Sem_2601_ExecuteStatement_002(integer p_value, charstring p_string, boolean p_bool) runs on GeneralComp { + if (match(p_value, 20) and + match(p_string, "hello") and + match(p_bool, true) + ){ + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + var integer v_test := 20; + execute(TC_Sem_2601_ExecuteStatement_002(v_test, "hello", true)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_003.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..002cac282fd7caae7e7446b0b3338a106bbdaa13 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_003.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:26.1, Ensure that the timeout specified with the execute statement is respected. + ** @verdict pass accept, ttcn3verdict:error + *****************************************************************/ + +module Sem_2601_ExecuteStatement_003 { + +type port P message { inout integer; } +type component GeneralComp { port P p; } + +testcase TC_Sem_2601_ExecuteStatement_003() runs on GeneralComp { + alt { // this alt is intentionally blocking! + [] any port.receive { + repeat; + } + } + setverdict(pass); +} + +control { + execute(TC_Sem_2601_ExecuteStatement_003(), 2.0); // let the testcase timeout after 2 seconds +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_004.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d88d894e3b6a7e3bbef617700b51a25e7287cfcd --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_004.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that the verdict none works correctly. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2601_ExecuteStatement_004 { + +type component GeneralComp { } + +testcase TC_Sem_2601_ExecuteStatement_004() runs on GeneralComp { + setverdict(none); +} + +testcase TC_Sem_2601_ExecuteStatement_004_second(verdicttype p_verdict) runs on GeneralComp { + if (p_verdict == none) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + var verdicttype v_result; + + v_result := execute(TC_Sem_2601_ExecuteStatement_004()); + execute(TC_Sem_2601_ExecuteStatement_004_second(v_result)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_005.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e67bc3e3955a0bd648eb899ebed739abb379fa46 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_005.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that the verdict pass works correctly. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ + +module Sem_2601_ExecuteStatement_005 { + +type component GeneralComp { } + +testcase TC_Sem_2601_ExecuteStatement_005() runs on GeneralComp { + setverdict(pass); +} + +testcase TC_Sem_2601_ExecuteStatement_005_second(verdicttype p_verdict) runs on GeneralComp { + if (p_verdict == pass) { + setverdict(fail); + } else { + setverdict(pass); + } +} + +control { + var verdicttype v_result; + + v_result := execute(TC_Sem_2601_ExecuteStatement_005()); + execute(TC_Sem_2601_ExecuteStatement_005_second(v_result)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_006.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bc3a41ae2f247bfd9113b7547a7cc57b55430f0 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_006.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that the verdict inconc works correctly. + ** @verdict pass accept, ttcn3verdict:inconc + *****************************************************************/ + +module Sem_2601_ExecuteStatement_006 { + +type component GeneralComp { } + +testcase TC_Sem_2601_ExecuteStatement_006() runs on GeneralComp { + setverdict(inconc); +} + +testcase TC_Sem_2601_ExecuteStatement_006_second(verdicttype p_verdict) runs on GeneralComp { + if (p_verdict == inconc) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + var verdicttype v_result; + + v_result := execute(TC_Sem_2601_ExecuteStatement_006()); + execute(TC_Sem_2601_ExecuteStatement_006_second(v_result)); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_007.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..572390ee8624fd826efb89d451c6b8804e2641a6 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_007.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that the timeout specified with the execute statement is respected. + ** @verdict pass accept, ttcn3verdict:error + *****************************************************************/ + +module Sem_2601_ExecuteStatement_007 { + + type component GeneralComp { } + + testcase TC_Sem_2601_ExecuteStatement_007() runs on GeneralComp { + while(true) { + // infinite loop + } + setverdict(pass); + } + + control { + execute(TC_Sem_2601_ExecuteStatement_007(), 2.0); // let the testcase execution timeout after 2 seconds + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_008.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..432c76021cde721b43cee702ef4642255259a17c --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_008.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that the user error sets the verdict error correctly. + ** @verdict pass accept, ttcn3verdict:error + *****************************************************************/ + +module Sem_2601_ExecuteStatement_008 { + + type component GeneralComp { } + + testcase TC_Sem_2601_ExecuteStatement_008() runs on GeneralComp { + testcase.stop("User error!"); + } + + control { + var verdicttype v_result; + + execute(TC_Sem_2601_ExecuteStatement_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_009.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a771315e7f28f692303c4823d87c9bd77d9213b1 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_009.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.1, Ensure that host id restriction is correctly handled. + ** @verdict pass accept, ttcn3verdict:error + *****************************************************************/ + +module Sem_2601_ExecuteStatement_009 { + + type component GeneralComp { } + + testcase TC_Sem_2601_ExecuteStatement_009(integer p_value, charstring p_string, boolean p_bool) runs on GeneralComp { + setverdict(pass); + } + + control { + var integer v_test := 20; + execute(TC_Sem_2601_ExecuteStatement_009(v_test, "hello", true), -, "wrong_host4232432432432432432432432432"); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_010.ttcn b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0edca7c89017d1b0dcf68c3fa2717f99e07c1f61 --- /dev/null +++ b/ATS/core_language/26_module_control/2601_execute_statement/Sem_2601_ExecuteStatement_010.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:26.1, verify that test cases can be executed from altsteps called from the control block + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirements are tested: +// c) The execute statement shall not be called from within an existing executing test behaviour +// chain called from a test case, i.e. test cases can only be executed from the control part or +// from functions or altsteps called directly or indirectly from the control part. + +module Sem_2601_ExecuteStatement_010 { + + type component GeneralComp { } + + testcase TC_Sem_2601_ExecuteStatement_010() runs on GeneralComp { + setverdict(pass); + } + + altstep a() { + [] any timer.timeout { + execute(TC_Sem_2601_ExecuteStatement_010()); + } + } + + control { + var verdicttype v_result; + timer t_tmr1 := 0.5, t_tmr2 := 2.0; + t_tmr1.start; + t_tmr2.start; + activate(a()); + alt { // t_tmr1 shall time out first triggering the default and thus executing the test case + [] t_tmr2.timeout { + } + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_001.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..668650dc7d387a4e21e893254c22e314e36e8f9a --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_001.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that setverdict statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_001 { + + type component GeneralComp { } + + control { + setverdict(pass); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_002.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8587814fa2b0187023724830b5d1283f2d62fb03 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_002.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the create component is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_002 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + control { + var MTCComp v_myComp := MTCComp.create; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_003.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe67b7bd60340b2d8a9afeb57c71aaf48f396b86 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_003.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the create alive component is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_003 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + control { + var MTCComp v_myComp := MTCComp.create alive; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_004.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..810633638bc04a67847a5a8a1f5c6810f6952d37 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_004.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the start statement is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_004 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + v_myComp.start(f_myBehavior()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_005.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..011598f75c7db0e7b870d1f16b2b75f95f2eb5e3 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_005.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the stop statement is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_005 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + v_myComp.start(f_myBehavior()); + v_myComp.stop; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_006.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b71590a71cf6d7d04a1882f9fc2d305c44b1e74e --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_006.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the kill statement is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_006 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + v_myComp.start(f_myBehavior()); + v_myComp.kill; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_007.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4112300b4502bb7f5a4b1635261ad8cdb593973b --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_007.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the alive operation is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_007 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + if (v_myComp.alive) { + // should be rejected + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_008.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..650790653a7f24cb58a0dd77dfe3ef5d62d39bf3 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_008.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the running operation is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_008 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + if (v_myComp.running) { + // should be rejected + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_009.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..981b75ae2111f84e9873521336e2ec77cbd855d4 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_009.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the done operation is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_009 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + v_myComp.start(f_myBehavior()); + v_myComp.done; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_010.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4a7b1ade78954010314301f6b007afed515c3e1 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_010.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the killed operation is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_010 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_myBehavior() runs on MTCComp { + setverdict(fail); + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + if (v_myComp.killed) { + // should be rejected + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_011.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a63bd281970212538a9be0fa7176872414ebf89 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_011.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the connect statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_011 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + type component PTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_firstComp := f_createComp(); // assume create was accepted + var PTCComp v_secondComp := f_createComp(); // assume create was accepted + + connect(v_firstComp:p,v_firstComp:p); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_012.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a0ba3764976c7be493854cb2bcdd137b51bb51d --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_012.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the disconnect statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_012 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + type component PTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_firstComp := f_createComp(); // assume create was accepted + var PTCComp v_secondComp := f_createComp(); // assume create was accepted + + disconnect(v_firstComp:p,v_firstComp:p); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_013.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a01d66207f0c476bbdafdeea3edaa10be5a22a1f --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_013.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the map statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_013 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + type component PTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_firstComp := f_createComp(); // assume create was accepted + var PTCComp v_secondComp := f_createComp(); // assume create was accepted + + map(v_firstComp:p,v_firstComp:p); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_014.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0d1272f4b9296308d046ae63f085ceeaf0df8cd4 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_014.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the unmap statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_014 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + type component PTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_firstComp := f_createComp(); // assume create was accepted + var PTCComp v_secondComp := f_createComp(); // assume create was accepted + + unmap(v_firstComp:p,v_firstComp:p); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_015.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4bd8f47ef97d62c9f6e6c9eaf195be2c992d6c1b --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_015.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the send statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_015 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.send(charstring:"foobar"); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_016.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cd00aad7bddefd1453383cb0cec7e4303201cd6 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_016.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the receive statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_016 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.receive(charstring:"foobar"); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_017.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c2656c2282e9e8c0f44e0e6b5716029550a81fe --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_017.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the call statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_017 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + template MyProcedure s_call := { 2, true } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.call(s_call); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_018.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3881c2fea898962fcc08c928644367ebfb0e915e --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_018.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the reply statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_018 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + template MyProcedure s_call := { 2, true } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.reply(s_call); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_019.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45b0f06575ba6d4df0c6dd82f04a8687d0cc3d21 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_019.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the raise statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_019 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + type charstring Exception; + + signature MyProcedure(integer p_value, boolean p_bool) exception (Exception); + + template Exception s_exception := "Thrown exception"; + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.raise(MyProcedure, s_exception); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_020.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f75c186bc318d345cd3aa151231b5e4807eb660f --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_020.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the trigger statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_020 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + var MyProcedure v_procValue; + v_myComp.p.trigger(MyProcedure:?) -> value v_procValue; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_021.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1aef9151b3563167ee50dc885bc458f706f3e40d --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_021.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the getcall statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_021 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + template MyProcedure s_expected := { 1, ? } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.getcall(s_expected); + } +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_022.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fa69b4e590952c8cf533c42a7727b7a41318fe08 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_022.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the getreply statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_022 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.getreply; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_023.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ee57b79d563a822a9a4827ec22cf10ee518f8c18 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_023.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the catch statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_023 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.catch; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_024.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4253b34869430a89ebba225f8d7f1fc349d76d79 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_024.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the check statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_024 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.check; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_025.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7a8118d9bd8c456fbcd69b6ab4dcaaa75ebcfef --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_025.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.2 + ** @purpose 1:26.2, Ensure that the clear statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_025 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.clear; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_026.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff5b9ca21edc4fcc5b0670dc53e031aff482db42 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_026.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the start statements on ports are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_026 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.start; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_027.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e72ad03e4ec3c25a40ea245f3a51c36ebb8c7448 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_027.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the stop statements on ports are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_027 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.stop; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_028.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3275b316237f6f1ccacc780276f9fd0c3a739eb3 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_028.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the halt statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_028 { + + type port MyPort procedure { + inout MyProcedure + } + + type component MTCComp { + port MyPort p; + } + + signature MyProcedure(integer p_value, boolean p_bool); + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + + v_myComp.p.halt; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_029.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d5b551849f78ae07081a582634afbbdb4c93b558 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_029.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that alternative behaviours are only used to control timer behavior in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_029 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + function f_createComp() return MTCComp { + return MTCComp.create; + } + + control { + var MTCComp v_myComp := f_createComp(); // assume create was accepted + alt { + [] v_myComp.p.receive(charstring:"foobar") { + } + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_030.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c26d42cd56b6f5fd737b9e686fbd7923209f31e --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_030.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that getverdict statements are not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_030 { + + type component GeneralComp { } + + control { + var verdicttype v_result; + v_result := getverdict; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_031.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6019423d35a451533d2400dad7d18b8f8f4923c3 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_031.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that execute statements are not executed from test cases. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_031 { + + type component GeneralComp { } + + testcase TC_NegSem_2602_TheControlPart_031() runs on GeneralComp { + setverdict(pass); + execute(TC_NegSem_2602_TheControlPart_031_second()); // shall be rejected + } + + testcase TC_NegSem_2602_TheControlPart_031_second() runs on GeneralComp { + setverdict(fail); + } + + + control { + execute(TC_NegSem_2602_TheControlPart_031()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_032.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ccaccb80911780779bd99c875a81edc81de6ecc8 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_032.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the create alive named component is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_032 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + control { + var MTCComp v_myComp := MTCComp.create("component name") alive; + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_033.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7bb8c3c3623722a95b195d0556373eb04d4500f --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_033.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the create named component is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_033 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + control { + var MTCComp v_myComp := MTCComp.create("component name"); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_034.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4a19d89a763fda5666ebb684136c8eca9bd97d4 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_034.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the create named component on host is not allowed in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_034 { + + type port MyPort message { + inout charstring + } + + type component MTCComp { + port MyPort p; + } + + control { + var MTCComp v_myComp := MTCComp.create("component name", "localhost"); + } +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_035.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4cf0b570531827fbcb0b59c9b35da31381b277f8 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/NegSem_2602_TheControlPart_035.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that alternative behaviours are only used to control timer behavior in the control part. + ** @verdict pass reject + *****************************************************************/ + +module NegSem_2602_TheControlPart_035 { + control { + alt { + [] any port.receive { + } + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_001.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27c399d73ea7c7a6eca014a203d08f1b04f4f926 --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_001.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the selection/deselection of test cases using boolean conditions works as expected. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2602_TheControlPart_001 { + + type component GeneralComp { } + + testcase TC_Sem_2602_TheControlPart_001() runs on GeneralComp { + setverdict(fail); + } + + testcase TC_Sem_2602_TheControlPart_001_second() runs on GeneralComp { + setverdict(pass); + } + + control { + if (false) { + execute(TC_Sem_2602_TheControlPart_001()); + } + + if (true) { + execute(TC_Sem_2602_TheControlPart_001_second()); + } + + if (not(1 == 1)) { + execute(TC_Sem_2602_TheControlPart_001()); + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_002.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab0812a3540178c68f872ae15459146b3d191a0c --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_002.ttcn @@ -0,0 +1,24 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the execution of test cases works from within a function. + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +module Sem_2602_TheControlPart_002 { + + type component GeneralComp { } + + testcase TC_Sem_2602_TheControlPart_002() runs on GeneralComp { + setverdict(pass); + } + + function f_testCaseExecutionFunction() { + execute(TC_Sem_2602_TheControlPart_002()); + } + + control { + f_testCaseExecutionFunction(); + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_003.ttcn b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23f5532f65c955a954b147e963f2c6f87c3f212a --- /dev/null +++ b/ATS/core_language/26_module_control/2602_the_control_part/Sem_2602_TheControlPart_003.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26.2, Ensure that the selection of test cases can be achieven based on resulting verdict types. + ** @verdict pass accept, ttcn3verdict:fail + *****************************************************************/ + +module Sem_2602_TheControlPart_003 { + + type component GeneralComp { } + + testcase TC_Sem_2602_TheControlPart_003() runs on GeneralComp { + setverdict(pass); + } + + testcase TC_Sem_2602_TheControlPart_003_second() runs on GeneralComp { + setverdict(fail); + } + + control { + var verdicttype v_result; + v_result := execute(TC_Sem_2602_TheControlPart_003()); + + if (v_result == pass) { + execute(TC_Sem_2602_TheControlPart_003_second()); + } + } + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_001.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8c083315a7a280073ae9b5219e748e9fb3e294d --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_001.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that assignments in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_001 { + +control{ + var integer v_foo := 2; +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_002.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e24ef8b6213e1bdc3e36f66d68c09b8517ce19e2 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_002.ttcn @@ -0,0 +1,18 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that if-else constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_002 { + +control{ + if (1 == 1) { + // do something + } else { + // do something else + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_003.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b16404935d0d9af0b55fd2af783f06f17cbd2aff --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_003.ttcn @@ -0,0 +1,25 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that select-case constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_003 { + +control{ + var integer v_test := 1; + select(v_test) { + case(1) { + // do something + } + case(2) { + // do something else + } + case else { + // do something else + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_004.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..711d33b882dabc7c23e86e20a444f83168e96026 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_004.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that for loop constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_004 { + +control{ + for (var integer v_i:=0; v_i < 10; v_i := v_i + 1) { + // do something + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_005.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..844548426c0fdab82dd1cde0c36193dd06fe8b7e --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_005.ttcn @@ -0,0 +1,17 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that while loop constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_005 { + +control{ + var integer v_i:=0; + while (v_i < 10) { + v_i := v_i + 1; + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_006.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59a52778c976b542fd1699e592051a5dde0315fd --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_006.ttcn @@ -0,0 +1,21 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that label and goto constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_006 { + +control{ + var integer v_i:=0; +label loop; + v_i := v_i + 1; + if (v_i > 10) { + goto end; + } + goto loop; +label end; +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_007.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c88aa5add04564deedee7137f06dbe9b8d7d501 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_007.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the stop construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_007 { + +control{ + stop; +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_008.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74d44e676af93356dd81d5c59abefc9bf19cd48f --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_008.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the break construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_008 { + +control{ + for (var integer v_i:=0; v_i < 10; v_i := v_i + 1) { + break; + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_009.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dd885aa6f9489622d4a0adf1af972f79ca90d14d --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_009.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the continue construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_009 { + +control{ + for (var integer v_i:=0; v_i < 10; v_i := v_i + 1) { + continue; + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_010.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b01dee70284c1feb73b46b5008269dbf787561cc --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_010.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the continue construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_010 { + +control{ + log("Hello World"); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_011.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..871127522a0340d17f4ea6d4d38bfdcf818b862e --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_011.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the alt/timeout construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_011 { + +control{ + timer t_timer; + t_timer.start(20E-3); + alt { + [] t_timer.timeout { + // do something + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_012.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32349bc9ad8890d0634bfef39814d0c674c96091 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_012.ttcn @@ -0,0 +1,20 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the repeat construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_012 { + +control{ + timer t_timer; + t_timer.start(20E-3); + alt { + [] t_timer.timeout { + repeat; + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_013.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..529b9b89a9c8e558aeb0ce8d88ef67a3b52a3017 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_013.ttcn @@ -0,0 +1,23 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the interleave construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_013 { + +control{ + timer t_timerOne; + timer t_timerTwo; + t_timerOne.start(20E-3); + t_timerTwo.start(30E-3); + interleave { + [] t_timerOne.timeout { + } + [] t_timerTwo.timeout { + } + } +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_015.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cc4338c1910563fd3bd30e41d195f59c485aa0d5 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_015.ttcn @@ -0,0 +1,29 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that start/stop/read/running timer constructs in the control part are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_015 { + +type component GeneralComp { } + +altstep a_test(timer p_timer) runs on GeneralComp { + [] p_timer.timeout { + } +} + +control{ + timer t_timer; + var float v_value; + t_timer.start(20E-3); + v_value := t_timer.read; + if (t_timer.running) { + // do something + } + + t_timer.stop; +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_016.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65bffc5480644def3a432aa958e0dc6a6b8f21ad --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_016.ttcn @@ -0,0 +1,14 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the action construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_016 { + +control{ + action("Send template on lower PCO now!"); +} + +} \ No newline at end of file diff --git a/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_017.ttcn b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b85fb3c1aee1aea2b9b3ea89007410485002d4e4 --- /dev/null +++ b/ATS/core_language/26_module_control/26_toplevel/Syn_26_ModuleControl_017.ttcn @@ -0,0 +1,19 @@ +/***************************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:26, Ensure that the execute construct in the control part is accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_26_ModuleControl_017 { + +type component GeneralComp { } + +testcase t_myTestCase() runs on GeneralComp { +} + +control{ + execute(t_myTestCase()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a5b083c5e1572ebcac01e0efdbf8fb05058eae8 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_001.ttcn @@ -0,0 +1,16 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Ensure that attributes for language elements are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_270101_ScopeOfAttributes_001 { + + type record of integer IntegerList + with { + display "colour red"; + extension "MyRule" + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..69e75fec2918a05624b54b34d77c90cd5ab6d952 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_002.ttcn @@ -0,0 +1,22 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Ensure that attributes for language elements are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_270101_ScopeOfAttributes_002 { + + type record MyRecord { + integer field1, + record { + integer innerField1, + boolean innerField2 + } field2 + } + with { + display "colour red"; + extension "MyRule" + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c256bab8d6b9f5ad9240739a65d2340548ab7652 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_003.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Ensure that attributes for individual fields are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_270101_ScopeOfAttributes_003 { + + type record of integer IntegerList + with { + display "colour red"; + extension "MyRule" + } + + const IntegerList c_MyIntegers1 := {0,1,2,3} + with { + display ([-]) "colour green" + } + + const IntegerList c_MyIntegers2 := {0,1,2,3} + with { + display ([0]) "colour black"; + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_004.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..14cf87e2147f947b24ab31b8afd92ce17685ccd3 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_004.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Ensure that attributes for individual fields are accepted. + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Syn_270101_ScopeOfAttributes_004 { + + type record MyRecord { + integer field1, + record { + integer innerField1, + boolean innerField2 + } field2 + } + with { + display "colour red"; + extension "MyRule" + } + + const MyRecord c_record := {0,{1,true}} + with { + display (field2.innerField1) "colour green" + } + + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03b37e599cf5d3c8c19256929a9e11797c9e6568 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270101_scope_of_attributes/Syn_270101_ScopeOfAttributes_005.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.1, Verify that attributes of synonym types can use field references + ** @verdict pass accept, noexecution + *****************************************************************/ + + // The following requirements are tested: + + // Attributes can be attached to synonym types (6.4). If the synonym type is a structured type, + // attributes in the with statement may reference fields or elements of this structured type. + +module Syn_270101_ScopeOfAttributes_004 { + + type record MyRecord { + integer field1, + record { + integer innerField1, + boolean innerField2 + } field2 + } + + type MyRecord MyRecord2 + with { + display(field1.innerField1) "colour red"; + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_001.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ca8013d8ea7de09c2663654e33f404e2bb9099d --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition that is directly attached to a lower scope unit will override a general attribute +// definition in a higher scope and a type-specific attribute inherited from a type reference. + +module Sem_27010200_general_001 { + + type component GeneralComp { + } + + type record R { + } with { encode "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_001 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_001()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_002.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..551b591e0c2486294eda05d38e809035402e9626 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_002.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from type reference + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition that is directly attached to a lower scope unit will override a general attribute +// definition in a higher scope and a type-specific attribute inherited from a type reference. + +module Sem_27010200_general_002 { + + type component GeneralComp { + } + + type integer I with { encode "RuleA" } + + type record R { + I field1 + } with { encode(field1) "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_002 () runs on GeneralComp { + var RoUC v_enc := R.field1.encode; + if(v_enc[0] == "RuleB") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_002()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_003.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..92265a01a87d5bad2feb11d8794d90ec500602bd --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_003.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from type reference override attributes from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes inherited from a type reference will override general attributes from a higher scope unit +// containing the type reference. + +module Sem_27010200_general_003 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "RuleA" } + + type record MyRecordB + { + MyRecordA field + } with { encode "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_003 () runs on GeneralComp { + var RoUC v_enc := MyRecordB.field.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010200_general_003()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_004.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..90327a993bf9a515819031afbf959fae2dc0e11e --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_004.ttcn @@ -0,0 +1,33 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower scopes override attribute from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A with statement that is placed inside the scope of another with statement shall override the outermost with. + +module Sem_27010200_general_004 { + + type component GeneralComp { + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_004 () runs on GeneralComp { + const integer c_zero := 0; + var RoUC v_enc := c_zero.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } with { encode "RuleA" } + + + control{ + execute(TC_Sem_27010200_general_004()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_005.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2be5296fd6518740428370da5f453459b0bf4e0 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_005.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from type reference override attributes from higher scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes inherited from a type reference will override general attributes from a higher scope unit. + +// Note: +// 1. The type R gets its attribute from the module +// 2. The constant c_r gets its attribute from two sources: the R type and the scope unit (the test case) +// 3. Because the R reference is preferred, the attribute originating from the module level will be used +// even though the scope unit where the c_r unit seemingly overrides it + + +module Sem_27010200_general_005 { + + type component GeneralComp { + } + + type record R { + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_005 () runs on GeneralComp { + const R c_r := {}; + var RoUC v_enc := c_r.encode; + if(v_enc[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } with { encode "RuleA" } + + + control{ + execute(TC_Sem_27010200_general_005()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_006.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef3a54c339474fd2d6e8e8fbbb28467b7244d397 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_006.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from lower group scopes override attribute from higher group scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A with statement that is placed inside the scope of another with statement shall override the outermost with. +// This shall also apply to the use of the with statement with groups. + +module Sem_27010200_general_006 { + + type component GeneralComp { + } + + group myPDUs + { + type record MyPDU1 { } + group mySpecialPDUs { + type record MyPDU2 { } + } with { extension "MySpecialRule" } + } with { + extension "MyRule"; + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_006 () runs on GeneralComp { + var RoUC v_enc1 := MyPDU1.extension, + v_enc2 := MyPDU2.extension; + if(v_enc1[0] == "MyRule" and v_enc2[0] == "MySpecialRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_006()); + } + +} with { extension "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_007.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ffb7362df4b2aebad9da2fe12aa5912f31d5cda --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_007.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that in case of multiple attributes all attributes are overridden + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If multiple attributes of the same type are allowed, all of them are overridden unless specified otherwise. + +module Sem_27010200_general_007 { + + type component GeneralComp { + } + + group myPDUs + { + type record MyPDU1 { } + group mySpecialPDUs { + type record MyPDU2 { } + } with { extension "MySpecialRule" } + } with { + extension "MyRule"; + extension "MyAdditionalRule" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_007 () runs on GeneralComp { + var RoUC v_enc := MyPDU2.extension; + if(lengthof(v_enc) == 1 and v_enc[0] == "MySpecialRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_007()); + } + +} with { extension "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_008.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a1965638f9719ff6839a17c74c8512d5fb78b69e --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_008.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes of synonym types do not override existing attributes of fields + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes defined for a synonym type don't override existing attributes of fields or elements of this synonym type. + +module Sem_27010200_general_008 { + + type component GeneralComp { + } + + type record SourceType2 { + integer field1, + integer field2 + } with { encode "Rule1" } + + type SourceType2 SynonymType2 with { encode "Rule3" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_008 () runs on GeneralComp { + var RoUC v_enc1 := SynonymType2.encode, + v_enc2 := SynonymType2.field1.encode, + v_enc3 := SynonymType2.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule3" and + lengthof(v_enc2) == 1 and v_enc2[0] == "Rule1" and + lengthof(v_enc3) == 1 and v_enc3[0] == "Rule1") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_009.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68703a8a2b0c1b3cca9e4e66dcdc1ba7c3f6623c --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_009.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes of synonym types apply to fields with no existing attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The attributes are applied to the fields or elements of synonym types only if the fields or elements have no +// valid attributes. + +module Sem_27010200_general_009 { + + type component GeneralComp { + } + + type record SourceType1 { + integer field1, + integer field2 + } + + type SourceType1 SynonymType1 with { encode "Rule2" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_009 () runs on GeneralComp { + var RoUC v_enc1 := SynonymType1.encode, + v_enc2 := SynonymType1.field1.encode, + v_enc3 := SynonymType1.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule2" and + lengthof(v_enc2) == 1 and v_enc2[0] == "Rule2" and + lengthof(v_enc3) == 1 and v_enc3[0] == "Rule2") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_009()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_010.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..615c373aaa9c0721369d86cdbb2de85c2b918144 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_010.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that @local attribute is not applied to lower scopes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes with the @local modifier override attributes from higher scope, but they are valid for the associated +// language element only. They do not affect definitions inside the associated language element as the @local +// attribute is completely transparent to lower scopes. + +module Sem_27010200_general_010 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode @local "Rule1" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_010 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode, + v_enc3 := R.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 0 and + lengthof(v_enc3) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_010()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_011.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75c36c648debc685646dc95e55f494edc2ee6b36 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_011.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that attributes from higher scopes are applied to lower scopes when @local attribute is between them + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Attributes from higher scope will still affect attributes in lower scopes even if the @local attribute is +// between them. + +module Sem_27010200_general_011 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode @local "Rule1" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_011 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode, + v_enc3 := R.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 1 and v_enc2[0] == "GeneralRule" and + lengthof(v_enc3) == 1 and v_enc3[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_011()); + } +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_012.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c52c71b4d89e35d3cafd45b34bc9f2a5346222a9 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_012.ttcn @@ -0,0 +1,41 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive overrides attribute from a reference + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An attribute definition in a lower scope or those inherited from a referenced type can be overwritten +// in a higher scope by using the override directive. + +module Sem_27010200_general_012 { + + type component GeneralComp { + } + + type record MyRecordA { + integer field1 + } with { encode "RuleA" } + + // In the following, fieldA of a MyRecordB instance is encoded according to RuleB + type record MyRecordB { + MyRecordA fieldA + } with { encode override "RuleB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_012 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordB.fieldA.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleB") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_012()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_013.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc7d2140b882f9b3b8fb4d1f54566f7da74526d0 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_013.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override is applied to lower scopes that do not declare the attribute + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The override directive overrides the specified attribute for all declarations at all lower scopes +// that do not also declare the specified attribute. + +module Sem_27010200_general_013 { + + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } with { encode "Rule1" } + + type record R2 { + R field + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_013 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R2.encode, + v_enc3 := R2.field.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and + lengthof(v_enc2) == 1 and v_enc2[0] == "GeneralRule" and + lengthof(v_enc3) == 1 and v_enc3[0] == "GeneralRule") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_013()); + } +} with { encode override "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_014.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd242776830909944f7569d34bdc0d367f3d3478 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_014.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that explicit attribute declaration prevents overwriting + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The override directive overrides the specified attribute for all declarations at all lower scopes +// that do not also declare the specified attribute. + +module Sem_27010200_general_014 { + + type component GeneralComp { + } + + // In the following, rule "RuleB" is overridden by "RuleC" for fieldC, but it is + // not overridden by "RuleA" of the group because the direct attachment to fieldC and + // MyRecordC override the encode of the outer scope. + group myGroup { + type record MyRecordC { + integer field1 + } with { encode override "RuleB" } + + type record MyRecordD { + MyRecordC fieldC + } with { encode override (fieldC) "RuleC" } + } with { encode override "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_014 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordD.fieldC.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleC") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_014()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_015.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f80c719d3e48b7abbcb536a5d1ac7bf9b53f698 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_015.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive applied to a type reference does not affect the referenced type + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If the override directive is applied to a type reference, it doesn't affect the attributes of the +// original referenced type. + +module Sem_27010200_general_015 { + + type component GeneralComp { + } + + type record MyRecordA { + integer field1 + } with { encode override "RuleA" } + + type record MyRecordB { + MyRecordA fieldA + } with { encode override "RuleB" } + + // The following template will use "RuleA" as the override directive for MyRecordB affects only + // MyRecordB.fieldA, but not the original MyRecordA. + template MyRecordA mw_msg := ?; + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_015 () runs on GeneralComp { + var RoUC v_enc1 := mw_msg.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_015()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_016.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..33c58d30046e95465d847a79f0400a0762d1d5b2 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010200_general/Sem_27010200_general_016.ttcn @@ -0,0 +1,49 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.0, Verify that override directive applied to a synonym type overrides field attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Override attribute applied to a synonym type(clause 6.4) overrides attributes of all fields or +// elements of the synonym type unless the synonym type definition contains an explicit attribute +// definition for the field or element + +module Sem_27010200_general_016 { + + type component GeneralComp { + } + + // MyRecordG and its "field1" member will be encoded with "RuleB", but its field2 member + // will be encoded with "RuleA", because there's an encode attribute explicitly declared + // for this field. + type record MyRecordF { + integer field1, + integer field2 + } with { encode "RuleA" } + + type MyRecordF MyRecordG with { + encode override "RuleB"; + encode(field2) "RuleA" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010200_general_016 () runs on GeneralComp { + var RoUC v_enc1 := MyRecordG.encode, + v_enc2 := MyRecordG.field1.encode, + v_enc3 := MyRecordG.field2.encode; + if(lengthof(v_enc1) == 1 and v_enc1[0] == "RuleB" and + lengthof(v_enc2) == 1 and v_enc2[0] == "RuleB" and + lengthof(v_enc3) == 1 and v_enc3[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_27010200_general_016()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3ec810bad374ee21f1e70bc89cbcd729a9d5edc --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_001.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that variant attributes can be overridden + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// A variant attribute overwrites a current variant attribute according to the rules defined +// in clause 27.1.2; + +module Sem_27010201_rules_for_variant_attributes_001 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { variant "VariantA" } + + type record MyRecordB + { + MyRecordA field + } with { variant "VariantB" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_001 () runs on GeneralComp { + var RoUC v_var1 := MyRecordB.variant, + v_var2 := MyRecordB.field.variant; + if(v_var1[0] == "VariantB" and + v_var2[0] == "VariantA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_001()); + } + +} with { encode "GeneralRule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1f2f71260f03f5c0051529fdbf186fc9fe5bc9c --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that encode attribute change disables existing variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding attribute, which overwrites a current encoding attribute according to +// the rules defined in clause 27.1.2, also overwrites a corresponding current variant +// attribute, i.e. no new variant attribute is provided, but the current variant attribute +// becomes inactive. + +module Sem_27010201_rules_for_variant_attributes_002 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_002 () runs on GeneralComp { + var RoUC v_var := MyRecordA.variant; + if(lengthof(v_var) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_002()); + } + +} with { encode "GeneralRule" variant "Variant1" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a0fb7db959f32ae2207c3ce6a6bc63cd0f0186ef --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010201_rules_for_variant_attributes/Sem_27010201_rules_for_variant_attributes_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.1, Verify that encode attribute repeating doesn't disable existing variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding attribute, which overwrites a current encoding attribute according to +// the rules defined in clause 27.1.2, also overwrites a corresponding current variant +// attribute, i.e. no new variant attribute is provided, but the current variant attribute +// becomes inactive. + +module Sem_27010201_rules_for_variant_attributes_003 { + + type component GeneralComp { + } + + type record MyRecordA { + } with { encode "GeneralRule" } // the same as in upper scope, variant should not change + + type record of universal charstring RoUC; + + testcase TC_Sem_27010201_rules_for_variant_attributes_003 () runs on GeneralComp { + var RoUC v_var := MyRecordA.variant; + if(lengthof(v_var) == 1 and v_var[0] == "Variant1") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010201_rules_for_variant_attributes_003()); + } + +} with { encode "GeneralRule" variant "Variant1" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2f414187ecd65e1b5a938c2f96ec7fabe45226b --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_001.ttcn @@ -0,0 +1,48 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.2, Verify that listed encode attributes retain variants + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Explicitly listed encode attributes that occur on the higher scope and are not overwritten +// will retain all variants related to them. + +module Sem_27010202_rules_for_multiple_encodings_001 { + + type component GeneralComp { + } + + type integer Int with { + encode "CodecA"; variant "CodecA"."Rule1"; + encode "CodecB"; variant "CodecB"."Rule2"; + } + + // Modifying list of allowed encodings + type Int Int2 with { + encode "CodecA"; // variant "CodecA"."Rule1" is kept + encode "CodecC"; variant "CodecC"."Rule6"; // new encoding and related variant + // "CodecB" encoding together with its variant are discarded as "CodecB" is not + // explicitly referenced + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010202_rules_for_multiple_encodings_001 () runs on GeneralComp { + var RoUC v_var1 := Int2.variant("CodecA"), + v_var2 := Int2.variant("CodecC"); + if(lengthof(v_var1) == 1 and v_var1[0] == "Rule1" and + lengthof(v_var2) == 1 and v_var2[0] == "Rule6") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010202_rules_for_multiple_encodings_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45e41799a8b890e652bd6415fa93e15be797edd9 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270102_overwriting_rules/27010202_rules_for_multiple_encodings/Sem_27010202_rules_for_multiple_encodings_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.2.2, Verify that encoding related variant doesn't overwrite variants of other encodings + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// An encoding related variant will overwrite only variants related to the same encoding. + +module Sem_27010202_rules_for_multiple_encodings_002 { + + type component GeneralComp { + } + + type integer Int with { + encode "CodecA"; variant "CodecA"."Rule1"; + encode "CodecB"; variant "CodecB"."Rule2"; + } + + // Overwriting variant with an encoding reference + type Int Int3 with { + variant "CodecB"."Rule4"; // new variant for encoding "CodecB" overwrites + // the original variant "CodecB"."Rule2" + // Variant "CodecA"."Rule1" is unchanged as this definition contains no reference + // to "CodecB" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_27010202_rules_for_multiple_encodings_002 () runs on GeneralComp { + var RoUC v_var1 := Int3.variant("CodecA"), + v_var2 := Int3.variant("CodecB"); + if(lengthof(v_var1) == 1 and v_var1[0] == "Rule1" and + lengthof(v_var2) == 1 and v_var2[0] == "Rule4") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_27010202_rules_for_multiple_encodings_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270103_attributes_of_imported_elements/Sem_270103_attributes_of_imported_elements_001.ttcn b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270103_attributes_of_imported_elements/Sem_270103_attributes_of_imported_elements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f590bac061457c07322c8dbc1c24babcdced9562 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2701_attribute_mechanism/270103_attributes_of_imported_elements/Sem_270103_attributes_of_imported_elements_001.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.1.3, Verify that attributes can be added to imported elements + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// In general, a language element is imported together with its attributes. In some cases these +// attributes may have to be changed when importing the language element, e.g. a type may be +// displayed in one module as ASP, then it is imported by another module where it should be +// displayed as PDU. For such cases it is allowed to change attributes on the import statement. +// When resolving the attributes, the import statement works as an additional higher scope unit +// on the top of the imported module. Attributes set in the import statement are valid only +// within the importing module. + +module Sem_270103_attributes_of_imported_elements_001 { + + import from Sem_270103_attributes_of_imported_elements_001_import { + type MyType + } with { + display "ASP" + }; + + type component GeneralComp {} + + testcase TC_Sem_270103_attributes_of_imported_elements_001() runs on GeneralComp { + if (MyType.display == "ASP") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_270103_attributes_of_imported_elements_001()); + } +} + +module Sem_270103_attributes_of_imported_elements_001_import { + type integer MyType; +} + diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_001.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e413331e3ae096ce1ccea1f299488f2310490f93 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that error is generated for an unknown DefinitionRef in module attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a: +// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module, +// group or definition to which the with statement is associated + +module NegSem_2702_the_with_statement_001 { + + type component GeneralComp { + } + + type record R { + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_001 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_001()); + } + +} with { encode(R2) "RuleA" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_002.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a0687dcca64f83a4b12a966f4edb92f4cd330fb7 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that error is generated for an unknown DefinitionRef in group attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a: +// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module, +// group or definition to which the with statement is associated + +module NegSem_2702_the_with_statement_002 { + group G { + type component GeneralComp { + } + + type record R { + } + } with { encode(R2) "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_002 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_003.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94bf5744b8ceedaf3079e7390a3a035ab1b2d157 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_003.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that error is generated for an unknown FieldReference in type attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a: +// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module, +// group or definition to which the with statement is associated + +module NegSem_2702_the_with_statement_003 { + + type component GeneralComp { + } + + type record R { + R field optional + } with { encode(field.field2) "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_003 () runs on GeneralComp { + var RoUC v_enc1 := R.field.encode, + v_enc2 := R.field.field.encode; + + if(lengthof(v_enc1) == 0 and v_enc2[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_004.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23037a117d24d766ec015da99a5a68ad7e4b33b0 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_004.ttcn @@ -0,0 +1,40 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that excluded definition cannot refer to a non-existent module item + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a: +// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module, +// group or definition to which the with statement is associated + +module NegSem_2702_the_with_statement_004 { + + type component GeneralComp { + } + + const integer c_int1 := 1; + const integer c_int2 := 2; + const integer c_int3 := 3; + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_004 () runs on GeneralComp { + var RoUC v_enc1 := c_int1.encode, + v_enc2 := c_int2.encode, + v_enc3 := c_int3.encode; + if(v_enc1[0] == "RuleA" and v_enc2[0] == "RuleA" and v_enc3[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_004()); + } + +} with { encode(const all except {c_int4}) "RuleA" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_005.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ffc4872384ae65fd022dc75092c6a0d8e7e55f3 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_005.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that excluded definition cannot refer to a non-existent group item + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a: +// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module, +// group or definition to which the with statement is associated + + +module NegSem_2702_the_with_statement_005 { + + group G { + type component GeneralComp { + } + + const integer c_int1 := 1; + const integer c_int2 := 2; + const integer c_int3 := 3; + } with { encode(const all except {c_int4}) "RuleA" } + + const integer c_int4 := 4; + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_005 () runs on GeneralComp { + var RoUC v_enc1 := c_int1.encode, + v_enc2 := c_int2.encode, + v_enc3 := c_int3.encode, + v_enc4 := c_int4.encode; + if(v_enc1[0] == "RuleA" and v_enc2[0] == "RuleA" and v_enc3[0] == "RuleA" and lengthof(v_enc4) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_005()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_006.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2cc7a3913580fdfcbed731203b75993576346b0 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_006.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that multiple attributes of the same kind cannot have different modifiers + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction b +// In case multiple attributes of the same type are allowed, all of them shall be without +// an additional modifier (override, @local) or the modifier shall be the same for all +// attributes. + +module NegSem_2702_the_with_statement_006 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + encode @local "RuleA"; + encode override "RuleB" + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_006 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode; + if(v_enc1 == { "RuleA", "RuleB" } and + lengthof(v_enc2) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_006()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_007.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..790be803f1b975991a71896be854dade8ac7d4d6 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_007.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that defining attributes of the same kind with and without a modifier is not possible + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction b +// In case multiple attributes of the same type are allowed, all of them shall be without +// an additional modifier (override, @local) or the modifier shall be the same for all +// attributes. + +module NegSem_2702_the_with_statement_007 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + encode @local "RuleA"; + encode "RuleB" + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_007 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode; + if(v_enc1 == { "RuleA", "RuleB" } and + lengthof(v_enc2) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSem_2702_the_with_statement_007()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_008.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27528979c3efa2c0dde9df4d1993cf3090c52a04 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_008.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that dot notation in the FreeText part in not possible for encode attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction c +// Dot notation in the FreeText part is allowed for variant attributes only. + +module NegSem_2702_the_with_statement_008 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + encode "RuleA"."Version1"; + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_008 () runs on GeneralComp { + var RoUC v_enc1 := R.encode; + setverdict(pass); + } + + control{ + execute(TC_NegSem_2702_the_with_statement_008()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_009.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fa7290adf6ca7fbd87a144baabd3bd74248d90e --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_009.ttcn @@ -0,0 +1,30 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that dot notation in the FreeText part in not possible for display attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction c +// Dot notation in the FreeText part is allowed for variant attributes only. + +module NegSem_2702_the_with_statement_009 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + display "RuleA"."Version1"; + } + + testcase TC_NegSem_2702_the_with_statement_009 () runs on GeneralComp { + var universal charstring v_d := R.display; + setverdict(pass); + } + + control{ + execute(TC_NegSem_2702_the_with_statement_009()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_010.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3edaa8b6cc3c35b91fe877a52505bcaf7d745d4f --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_010.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that dot notation in the FreeText part in not possible for optional attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction c +// Dot notation in the FreeText part is allowed for variant attributes only. + +module NegSem_2702_the_with_statement_010 { + type component GeneralComp { + } + + type record R { + integer field1, + integer field2 + } + + template R m_msg := { + } with { + optional "implicit omit".""; + } + + testcase TC_NegSem_2702_the_with_statement_010 () runs on GeneralComp { + var universal charstring v_opt := m_msg.optional; + setverdict(pass); + } + + control{ + execute(TC_NegSem_2702_the_with_statement_010()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_011.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..193f73cf9500502220a02e4714bce4c3c0de5810 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSem_2702_the_with_statement_011.ttcn @@ -0,0 +1,32 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that dot notation in the FreeText part in not possible for extension attributes + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction c +// Dot notation in the FreeText part is allowed for variant attributes only. + +module NegSem_2702_the_with_statement_011 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + extension "RuleA"."Version1"; + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2702_the_with_statement_011 () runs on GeneralComp { + var RoUC v_ext := R.extension; + setverdict(pass); + } + + control{ + execute(TC_NegSem_2702_the_with_statement_011()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSyn_2702_the_with_statement_001.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSyn_2702_the_with_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7d9a4ad62e5e78f4c5486464114c86069507989 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/NegSyn_2702_the_with_statement_001.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that string constant cannot be used in an attribute definition + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// The syntax for the argument of the with statement (i.e. the actual attributes) is defined as a free text string. + +module NegSyn_2702_the_with_statement_001 { + + type component GeneralComp { + } + + const charstring c_enc := "RuleA"; + + type record R { + } with { encode c_enc } + + type record of universal charstring RoUC; + + testcase TC_NegSyn_2702_the_with_statement_001 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_NegSyn_2702_the_with_statement_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_001.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..785a426f9742415bd94eec1c5a1691262bdfc882 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that DefinitionRef can be used to identify a field within a module + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// DefinitionRef and FieldReference identify a definition or field respectively which is within the module, group or +// definition to which the with statement is associated. + +module Sem_2702_the_with_statement_001 { + + type component GeneralComp { + } + + type record R { + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_001 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_001()); + } + +} with { encode(R) "RuleA" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_002.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39438b8bb4f3389b202dbe0e1d0ed2f02a0572e2 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that DefinitionRef can be used to identify a field within a group + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// DefinitionRef and FieldReference identify a definition or field respectively which is within the module, group or +// definition to which the with statement is associated. + +module Sem_2702_the_with_statement_002 { + group G { + type component GeneralComp { + } + + type record R { + } + } with { encode(R) "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_002 () runs on GeneralComp { + var RoUC v_enc := R.encode; + if(v_enc[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_003.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65058d43213613034dd376b9befaa4ad4b3dc20f --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_003.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that FieldReference can be used to identify a field within a definition + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// DefinitionRef and FieldReference identify a definition or field respectively which is within the module, group or +// definition to which the with statement is associated. + +module Sem_2702_the_with_statement_003 { + + type component GeneralComp { + } + + type record R { + R field optional + } with { encode(field.field) "RuleA" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_003 () runs on GeneralComp { + var RoUC v_enc1 := R.field.encode, + v_enc2 := R.field.field.encode; + + if(lengthof(v_enc1) == 0 and v_enc2[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_003()); + } +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_004.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..386bb21c1cc2a29f5551e44e20ba534aabc6feb5 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_004.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that AllRef can be used to apply attributes to multiple module items + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// AllRef can be used to apply attributes to multiple language elements defined within the scope to +// which the with statement is associated. AllRef provides a flexible mechanism to select all language +// elements or all language elements of a certain kind defined in a given scope. + +module Sem_2702_the_with_statement_004 { + + type component GeneralComp { + } + + const integer c_int := 1; + modulepar integer PX_INT := 1; + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_004 () runs on GeneralComp { + var RoUC v_enc1 := c_int.encode, + v_enc2 := PX_INT.encode; + if(v_enc1[0] == "RuleA" and lengthof(v_enc2) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_004()); + } + +} with { encode(const all) "RuleA" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_005.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..969d96067f90efc2cc8994ebfebb7908a7b805c9 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_005.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that AllRef can be used to apply attributes to multiple group items + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// AllRef can be used to apply attributes to multiple language elements defined within the scope to +// which the with statement is associated. AllRef provides a flexible mechanism to select all language +// elements or all language elements of a certain kind defined in a given scope. + +module Sem_2702_the_with_statement_005 { + + group G { + type component GeneralComp { + } + + const integer c_int := 1; + modulepar integer PX_INT := 1; + } with { encode(const all) "RuleA" } + + const integer c_int2 := 0; + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_005 () runs on GeneralComp { + var RoUC v_enc1 := c_int.encode, + v_enc2 := PX_INT.encode, + v_enc3 := c_int2.encode; + if(v_enc1[0] == "RuleA" and lengthof(v_enc2) == 0 and lengthof(v_enc3) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_005()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_006.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6abcff3734e2c594cb77c794d8bad78514789d61 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_006.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that definitions can be excluded if AllRef is used in the with clause on a module level + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Individual language elements that are not affected by an attribute can be excluded from a set of selected +// language elements in the except clause. + +module Sem_2702_the_with_statement_006 { + + type component GeneralComp { + } + + const integer c_int1 := 1; + const integer c_int2 := 2; + const integer c_int3 := 3; + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_006 () runs on GeneralComp { + var RoUC v_enc1 := c_int1.encode, + v_enc2 := c_int2.encode, + v_enc3 := c_int3.encode; + if(v_enc1[0] == "RuleA" and lengthof(v_enc2) == 0 and v_enc3[0] == "RuleA") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_006()); + } + +} with { encode(const all except {c_int2}) "RuleA" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_007.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..75819bfa5ffc76853496c834949b847d74b1d129 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_007.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that definitions can be excluded if AllRef is used in the with clause on a module level + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Individual language elements that are not affected by an attribute can be excluded from a set of selected +// language elements in the except clause. + +module Sem_2702_the_with_statement_007 { + + group G { + type component GeneralComp { + } + + const integer c_int1 := 1; + const integer c_int2 := 2; + const integer c_int3 := 3; + } with { encode(const all except {c_int2}) "RuleA" } + + const integer c_int4 := 4; + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_007 () runs on GeneralComp { + var RoUC v_enc1 := c_int1.encode, + v_enc2 := c_int2.encode, + v_enc3 := c_int3.encode, + v_enc4 := c_int4.encode; + if(v_enc1[0] == "RuleA" and lengthof(v_enc2) == 0 and v_enc3[0] == "RuleA" and lengthof(v_enc4) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_007()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_008.ttcn b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..526d77eecb1b63e39dd5c154d0a37a6a5ca5395b --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2702_the_with_statement/Sem_2702_the_with_statement_008.ttcn @@ -0,0 +1,43 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.2, Verify that multiple attributes of the same kind can have the same modifier + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Restriction b +// In case multiple attributes of the same type are allowed, all of them shall be without +// an additional modifier (override, @local) or the modifier shall be the same for all +// attributes. + +module Sem_2702_the_with_statement_008 { + type component GeneralComp { + } + + type record R { + integer field1 + } with { + encode @local "RuleA"; + encode @local "RuleB" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2702_the_with_statement_008 () runs on GeneralComp { + var RoUC v_enc1 := R.encode, + v_enc2 := R.field1.encode; + if(v_enc1 == { "RuleA", "RuleB" } and + lengthof(v_enc2) == 0) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + + control{ + execute(TC_Sem_2702_the_with_statement_008()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b525d012f301c6afb542b3e6ce5621095660acfe --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_001.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.3, Verify that only one display attribute can be defined for a definition + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a +// At most one display attribute shall be applied to each definition, each individual field reference or +// language element to which a with statement is associated. + +module NegSem_2703_display_attributes_001 { + + type component GeneralComp { + } + + type record MyService { + integer i, + float f + } with { display "ServiceCall" display "blue"} // MyRecord will be displayed as a ServiceCall + + testcase TC_NegSem_2703_display_attributes_001 () runs on GeneralComp { + var universal charstring v_display := MyService.display; + if(v_display == "ServiceCall") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_2703_display_attributes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..95810f612e276bd807ae943621fe8663b9bc10e1 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.3, Verify that only one display attribute can be defined for a field + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a +// At most one display attribute shall be applied to each definition, each individual field reference or +// language element to which a with statement is associated. + +module NegSem_2703_display_attributes_002 { + + type component GeneralComp { + } + + type record MyService { + integer i, + float f + } with { display(f) "ServiceCall" display(f) "blue"} + + testcase TC_NegSem_2703_display_attributes_002 () runs on GeneralComp { + var universal charstring v_display := MyService.f.display; + if(v_display == "ServiceCall") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_2703_display_attributes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9c3a6c64e130c5ad065cf4c61566d8e9623d41aa --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2703_display_attributes/NegSem_2703_display_attributes_003.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.3, Verify that only one display attribute can be defined for a definition + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a +// At most one display attribute shall be applied to each definition, each individual field reference or +// language element to which a with statement is associated. + +module NegSem_2703_display_attributes_003 { + + type component GeneralComp { + } + + type record MyService { + integer i, + float f + } + + testcase TC_NegSem_2703_display_attributes_003 () runs on GeneralComp { + var universal charstring v_display := MyService.display; + if(v_display == "ServiceCall") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_2703_display_attributes_003()); + } + +} with { display "ServiceCall" display "blue"} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2703_display_attributes/Sem_2703_display_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2703_display_attributes/Sem_2703_display_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..36fe8a17c61b44b82d8e10e34a4871496798f281 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2703_display_attributes/Sem_2703_display_attributes_001.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.3, Verify that display attribute can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// All TTCN-3 language elements can have display attributes to specify how particular language elements shall be +// displayed in. + +module Sem_2703_display_attributes_001 { + + type component GeneralComp { + } + + type record MyService { + integer i, + float f + } with { display "ServiceCall" } // MyRecord will be displayed as a ServiceCall + + testcase TC_Sem_2703_display_attributes_001 () runs on GeneralComp { + var universal charstring v_display := MyService.display; + if(v_display == "ServiceCall") { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2703_display_attributes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd054ae53341d0c3db93971120eeb8fde72b841a --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_001.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.4, Verify that a single encode attribute can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Encoding rules define how a particular value, template, etc. shall be encoded and transmitted +// over a communication port and how received signals shall be decoded. TTCN-3 does not have +// a default encoding mechanism. This means that encoding rules or encoding directives are defined +// in some external manner to TTCN-3. +// The encode attribute allows the association of some referenced encoding rule or encoding +// directive to be made to a TTCN-3 definition. + +module Sem_2704_encoding_attributes_001 { + + type component GeneralComp { + } + + type charstring MyType; // Normally encoded according to the "Global encoding rule" + group myRecords { + type record MyPDU1 { + integer field1, // field1 will be encoded according to "Rule 3" + boolean field2, // field2 will be encoded according to "Rule 3" + MyType field3 // field3 will be encoded according to "Rule 2" + } with { encode (field1, field2) "Rule 3" } + } with { encode "Rule 2" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2704_encoding_attributes_001 () runs on GeneralComp { + var RoUC v_enc := MyPDU1.encode; + if(v_enc == { "Rule 2" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2704_encoding_attributes_001()); + } + +} with { encode "Global encoding rule" } \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39ace9711008fe1f02406295edf9fd454a54b200 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2704_encoding_attributes/Sem_2704_encoding_attributes_002.ttcn @@ -0,0 +1,37 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.4, Verify that multiple encode attributes can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The with statement may contain more than one encode attribute. In this case, multiple encodings are +// supported in the context where the attribute is used. + +module Sem_2704_encoding_attributes_002 { + + type component GeneralComp { + } + + type record MyPDU { + integer field1, + boolean field2 + } with { encode "Codec A" encode "Codec B" encode "Codec C" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2704_encoding_attributes_002 () runs on GeneralComp { + var RoUC v_enc := MyPDU.encode; + if(v_enc == { "Codec A", "Codec B", "Codec C" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2704_encoding_attributes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..35aa613f9eeccf0832d539eb0e5d9d2401109fe1 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_001.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that a variant with no encoding references is not allowed for multiple encodings + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// It is not allowed to define variant attributes with no encoding reference if multiple encodings +// are used. + +module NegSem_2705_variant_attributes_001 { + + type component GeneralComp { + } + + type charstring Multi3 with { + encode "Codec1"; encode "Codec2"; + variant "Rule1"; + } // the statement will produce an error as there are multiple encodings and the + // variant attribute doesn't specify encoding reference + + type record of universal charstring RoUC; + + testcase TC_NegSem_2705_variant_attributes_001 () runs on GeneralComp { + var RoUC v_variant := Multi3.variant; + if(v_variant == { "Rule1" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_2705_variant_attributes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3ca4389b3c533becff3d0e79ab08e991317065e --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_002.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that an error is generated if variant contains an unknown encoding reference + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a) +// When dot notation is used in the variant attribute value for an element, the strings preceding +// the dot symbol shall resolve into one of the encode attribute values associated with the same +// element. + +module NegSem_2705_variant_attributes_002 { + + type component GeneralComp { + } + + type charstring Multi with { + encode "Codec1"; encode "Codec2"; + variant "Codec3"."Rule1"; + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2705_variant_attributes_002 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_NegSem_2705_variant_attributes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d85bc6b9973350a6af81ddddde22517aca7e08ab --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/NegSem_2705_variant_attributes_003.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that an error is generated if variant contains an unknown encoding reference (inside a list) + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a) +// When dot notation is used in the variant attribute value for an element, the strings preceding +// the dot symbol shall resolve into one of the encode attribute values associated with the same +// element. + +module NegSem_2705_variant_attributes_003 { + + type component GeneralComp { + } + + type charstring Multi with { + encode "Codec1"; encode "Codec2"; + variant {"Codec1", "Codec3"}."Rule1"; + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2705_variant_attributes_003 () runs on GeneralComp { + setverdict(pass); + } + + control{ + execute(TC_NegSem_2705_variant_attributes_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7fcee9e3006b7bf3cccfed8375d1eab2507d2778 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_001.ttcn @@ -0,0 +1,39 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that a single variant attribute can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// To specify a refinement of the currently specified encoding scheme instead of its replacement, +// the variant attribute shall be used. The variant attributes are different from other attributes, +// because they are closely related to encode attributes. Therefore, for variant attributes, +// additional overwriting rules apply (see clause 27.1.2.1). + +module Sem_2705_variant_attributes_001 { + + type component GeneralComp { + } + + type record MyPDU { + integer field1, + boolean field2 + } with { variant "Rule A" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2705_variant_attributes_001 () runs on GeneralComp { + var RoUC v_variant := MyPDU.variant; + if(v_variant == { "Rule A" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2705_variant_attributes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c49410ba501df333233fa27e7d905968f292e67 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_002.ttcn @@ -0,0 +1,36 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that multiple variant attributes can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The with statement can contain any number of variant attributes. + +module Sem_2705_variant_attributes_002 { + + type component GeneralComp { + } + + type record MyPDU { + integer field1, + boolean field2 + } with { variant "Rule A" encode "Rule B" encode "Rule C" } + + type record of universal charstring RoUC; + + testcase TC_Sem_2705_variant_attributes_002 () runs on GeneralComp { + var RoUC v_enc := MyPDU.encode; + if(v_enc == { "Rule A", "Rule B", "Rule C" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2705_variant_attributes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a8cda6ec60d25e70a891272e3d465168e3b22cb7 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_003.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that a dot notation is available for variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If multiple encodings (see clause 27.4) are used, the variant attribute value shall be composed +// of two parts separated by a dot. Such variant attributes are called encoding related variant +// attributes. The first part of the attribute specifies the encodings the variant is related to. +// One possible notation is a simple string when the variant is related to a single encode attribute. +// The second part of the attribute (following the dot symbol) is a simple string that specifies the +// variant value. + +module Sem_2705_variant_attributes_003 { + + type component GeneralComp { + } + + type charstring Multi with { + encode "Codec1"; variant "Codec1"."Rule1"; + encode "Codec2"; variant "Codec2"."Rule3"; + }; // multiple encodings ("Codec1", "Codec2"), the variant "Rule1" is valid + // for the "Codec1" encoding only, while the variant "Rule3" applies only + // for the "Codec2" encoding + + type record of universal charstring RoUC; + + testcase TC_Sem_2705_variant_attributes_003 () runs on GeneralComp { + var RoUC v_variant1 := Multi.variant("Codec1"), + v_variant2 := Multi.variant("Codec2"); + if(v_variant1 == { "Rule1" } and v_variant2 == { "Rule3" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2705_variant_attributes_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_004.ttcn b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d417ebbe9faa676ea70df2bb777ce77a361bf9b5 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2705_variant_attributes/Sem_2705_variant_attributes_004.ttcn @@ -0,0 +1,42 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.5, Verify that a dot notation is available for variant attributes + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// If multiple encodings (see clause 27.4) are used, the variant attribute value shall be composed +// of two parts separated by a dot. Such variant attributes are called encoding related variant +// attributes. The first part of the attribute specifies the encodings the variant is related to. +// One possible notation is a comma separated list of strings enclosed in curly brackets if +// the variant is related to multiple encodings. The second part of the attribute (following the dot +// symbol) is a simple string that specifies the variant value. + +module Sem_2705_variant_attributes_004 { + + type component GeneralComp { + } + + type charstring Multi2 with { + encode "Codec1"; encode "Codec2"; + variant {"Codec1","Codec2"}."Rule1"; + }; // multiple encodings ("Codec1", "Codec2"), variant "Rule1" applies to both of them + + type record of universal charstring RoUC; + + testcase TC_Sem_2705_variant_attributes_004 () runs on GeneralComp { + var RoUC v_variant1 := Multi2.variant("Codec1"), + v_variant2 := Multi2.variant("Codec2"); + if(v_variant1 == { "Rule1" } and v_variant2 == { "Rule1" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2705_variant_attributes_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e12c2f60294ba4ddae35e4a7209def9182c89c5 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_001.ttcn @@ -0,0 +1,34 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.6, Verify that a single extension attribute can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Extension attributes can be used for proprietary extensions to TTCN-3. The with statement may contain +// any number of extension attributes. + +module Sem_2706_extension_attributes_001 { + + type component GeneralComp { + } + + type charstring MyType with { extension "My custom extension" }; + + type record of universal charstring RoUC; + + testcase TC_Sem_2706_extension_attributes_001 () runs on GeneralComp { + var RoUC v_ext := MyType.extension; + if(v_ext == { "My custom extension" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2706_extension_attributes_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e520c4dd5bfbc8ee4418167243e9ff5427a9ce1 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2706_extension_attributes/Sem_2706_extension_attributes_002.ttcn @@ -0,0 +1,38 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.6, Verify that multiple extension attributes can be defined + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// Extension attributes can be used for proprietary extensions to TTCN-3. The with statement may contain +// any number of extension attributes. + +module Sem_2706_extension_attributes_002 { + + type component GeneralComp { + } + + type charstring MyType with { + extension "My custom extension"; + extension "Second extension"; + extension "Yet another extension"; + }; + + type record of universal charstring RoUC; + + testcase TC_Sem_2706_extension_attributes_002 () runs on GeneralComp { + var RoUC v_ext := MyType.extension; + if(v_ext == { "My custom extension", "Second extension", "Yet another extension" }) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_2706_extension_attributes_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb3700e350e065f9f9a0d64845e97197247d5c5c --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_001.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 433 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass reject + ***************************************************/ + +module NegSem_2707_OptionalAttributes_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } with { optional "implicit omit"} + // the optional keyword is forbidden here, because according to the restriction 27.7.a + // a port type shall not have an optional attribute associated to them directly. + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_2707_OptionalAttributes_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + +} + +control{ + execute(TC_NegSem_2707_OptionalAttributes_001()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca27c377296d48d2e48160b75602fe886753f53e --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_002.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass reject + ***************************************************/ + +module NegSem_2707_OptionalAttributes_002 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } with { optional "implicit omit"} //not valid optional attribute + // TT: this is not forbidden, it just should not have any effect on the templates + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_2707_OptionalAttributes_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + +} + +control{ + execute(TC_NegSem_2707_OptionalAttributes_002()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9fbec0f36ded5d7a420dcdaa8f53e896440fee9 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/NegSem_2707_OptionalAttributes_003.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass reject + ***************************************************/ + +module NegSem_2707_OptionalAttributes_003 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {b:=3,c:=true}, //a is still undefined + field7 := {a:=3,c:=true}, //b is still undefined + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional (field6.a, field7.b) "implicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=3,b:=3,c:=true}, + field7 := {a:=3,b:=3,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_2707_OptionalAttributes_003() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { //cannot match not fully defined template + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_2707_OptionalAttributes_003()); +} + +} with { optional override "explicit omit"} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3db024f4f9f3737615dcc6168593233dba89daa5 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_001.ttcn @@ -0,0 +1,104 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {c:=true}, //a and b fields are omitted + field7 := {c:=true}, //a and b fields are omitted + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "implicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=omit,c:=true}, + field7 := {a:=omit,b:=1,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_001() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_001()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_002.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b74564e5d24eea23e2d9ed37873756132482e5d --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_002.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_002 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, //a and b fields are specifically defined + field7 := {a:=1,b:=2,c:=true}, //a and b fields are specifically defined + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "implicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_002() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_002()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_003.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f82f758424a6d011e03d44a9ebcdea46cc2d63d --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_003.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_003 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, //a and b fields are specifically defined + field7 := {a:=1,b:=2,c:=true}, //a and b fields are specifically defined + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "explicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_003() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_003()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_004.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b05ef9d5e721f92235aa626174d9123ba318768d --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_004.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_004 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, //a and b fields are specifically defined + field7 := {a:=omit,b:=omit,c:=true}, //a and b fields are specifically defined + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "explicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_004() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_004()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_005.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b42a7415b13c531a820001d8c9128d4a7d407c27 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_005.ttcn @@ -0,0 +1,104 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_005 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {b:=3,c:=true}, //a is omitted + field7 := {a:=3,c:=true}, //b is omitted + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional (field6, field7) "implicit omit"} + + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=3,b:=3,c:=true}, + field7 := {a:=3,b:=3,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_005() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_005()); +} + +} with { optional "explicit omit"} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_006.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..260ce5df06679f54d6339be265b23459dbbabe4b --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_006.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_006 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {c:=true}, //a and b fields are omitted + field7 := {c:=true}, //a and b fields are omitted + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=omit,c:=true}, + field7 := {a:=omit,b:=1,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_006() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_006()); +} + +} with { optional "implicit omit"} //this attribute has an effect only on the template definition in the module diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_007.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a942c1481a74079a04cf700514bbe504777a80ff --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Sem_2707_OptionalAttributes_007.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_2707_OptionalAttributes_007 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {c:=true}, //a and b fields are omitted + field7 := {c:=true}, //a and b fields are omitted + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "implicit omit"} + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_2707_OptionalAttributes_007() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_2707_OptionalAttributes_007()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Syn_2707_OptionalAttributes_001.ttcn b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Syn_2707_OptionalAttributes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..67042f9cdeb6faec00e2191f2373e58ecfa46c9f --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2707_optional_attributes/Syn_2707_OptionalAttributes_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:27.7, Ensure that the IUT correctly handles attribute definitions and their scoping rules + ** @verdict pass accept, noexecution + ***************************************************/ + +module Syn_2707_OptionalAttributes_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + const MessageType c_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=omit,b:=omit,c:=true}, + field7 := {a:=omit,b:=omit,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } with { optional "implicit omit"} //optional attribute can be accepted on constants + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Syn_2707_OptionalAttributes_001() runs on GeneralComp { + + var MessageType v_testMessage:=c_testMessage; + +} + +control{ + + execute(TC_Syn_2707_OptionalAttributes_001()); +} + +} diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_001.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..410db2f4298456f9f0a990ba4acfecd9c67b5bed --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_001.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode can reference only types listed in port definitions + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a +// If the setencode operation is applied to a single port, the referenced type shall be +// either listed in the in or out type list of the related port type or it shall be +// a reference to a field or element on any level of nesting of a type listed in the in +// or out type list of the related port type. + +module NegSem_2709_dynamic_configuration_001 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record MyPDU2 { + charstring field1, + charstring field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2709_dynamic_configuration_001 () runs on GeneralComp { + p.setencode(MyPDU2, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_NegSem_2709_dynamic_configuration_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_002.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82a3bf48471c0854d46fc5c95ac18711fec5fc52 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_002.ttcn @@ -0,0 +1,56 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode can reference only fields of types listed in port definitions + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction a +// If the setencode operation is applied to a single port, the referenced type shall be +// either listed in the in or out type list of the related port type or it shall be +// a reference to a field or element on any level of nesting of a type listed in the in +// or out type list of the related port type. + +module NegSem_2709_dynamic_configuration_002 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record MyPDU2 { + charstring field1, + charstring field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2709_dynamic_configuration_002 () runs on GeneralComp { + p.setencode(MyPDU2.field1, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_NegSem_2709_dynamic_configuration_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_003.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fa0e9b3ef8742760435a2a0f584634f7b3ff863 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_003.ttcn @@ -0,0 +1,50 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode cannot reference templates in the first parameter + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// The setencode operation can be used on a port or set of ports to dynamically select +// for the affected ports a single encode attribute value to be used for a type that +// has multiple encode attributes attached to it. + +module NegSem_2709_dynamic_configuration_003 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + template MyPDU m_msg := { + field1 := 1, + field2 := true + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2709_dynamic_configuration_003 () runs on GeneralComp { + p.setencode(m_msg, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_NegSem_2709_dynamic_configuration_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_004.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..42315737eddda63d03c6d53800f86f4708605e00 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/NegSem_2709_dynamic_configuration_004.ttcn @@ -0,0 +1,45 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that an error is generated if the second parameter of the setencode operation is not a universal charstring + ** @verdict pass reject + *****************************************************************/ + +// The following requirement is tested: +// Restriction b +// The SingleExpression used in the second parameter of the setencode operation shall be +// compatible with the universal charstring type. + +module NegSem_2709_dynamic_configuration_004 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_NegSem_2709_dynamic_configuration_004 () runs on GeneralComp { + p.setencode(MyPDU, 1); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_NegSem_2709_dynamic_configuration_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_001.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..074979ac74e3615f2c7f390cb14e6f3f728b2698 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_001.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode operation can be applied to a port + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The setencode operation dynamically restricts the number of encode attribute values of +// a referenced type or its fields or elements to a single value. Dependent on the +// language element preceding the dot, the encoding configuration is valid ... for all +// sending and receiving operations of a single port (single port reference)... + +module Sem_2709_dynamic_configuration_001 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2709_dynamic_configuration_001 () runs on GeneralComp { + p.setencode(MyPDU, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_Sem_2709_dynamic_configuration_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_002.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..339f0778b039974670093a72f0e37cc86140f03c --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_002.ttcn @@ -0,0 +1,47 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode operation can be applied to all ports + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The setencode operation dynamically restricts the number of encode attribute values of +// a referenced type or its fields or elements to a single value. Dependent on the +// language element preceding the dot, the encoding configuration is valid ... for all +// sending and receiving operations of all ports of the current component (all port +// notation)... + +module Sem_2709_dynamic_configuration_002 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2709_dynamic_configuration_002 () runs on GeneralComp { + all port.setencode(MyPDU, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_Sem_2709_dynamic_configuration_002()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_003.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..94fc71536451c5c8f7cb6455833e98555855312a --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_003.ttcn @@ -0,0 +1,46 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that the setencode operation can be applied to a port + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// The setencode operation dynamically restricts the number of encode attribute values of +// a referenced type or its fields or elements to a single value. Dependent on the +// language element preceding the dot, the encoding configuration is valid ... all codec +// functions and communication operations of the current component (self keyword). + +module Sem_2709_dynamic_configuration_003 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2709_dynamic_configuration_003 () runs on GeneralComp { + self.setencode(MyPDU, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_Sem_2709_dynamic_configuration_003()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_004.ttcn b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c4a5c78a21018387ee3a82e262a273527c91a94 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/2709_dynamic_configuration/Sem_2709_dynamic_configuration_004.ttcn @@ -0,0 +1,44 @@ +/***************************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 1:27.9, Verify that an extended type reference can be used in the setencode operation + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ + +// The following requirement is tested: +// It is allowed to reference a field or element of a type using an extended type +// reference in the setencode operation. + +module Sem_2709_dynamic_configuration_004 { + + type port P message { + inout MyPDU; + } + + type component GeneralComp { + port P p; + } + + type record MyPDU { + integer field1, + boolean field2 + } with { + encode "Codec 1"; + encode "Codec 2"; + encode "Codec 3" + } + + type record of universal charstring RoUC; + + testcase TC_Sem_2709_dynamic_configuration_004 () runs on GeneralComp { + p.setencode(MyPDU.field1, "Codec 1"); + // Compilation and seamless execution tested. + // Actual effect not tested as it would require dedicated TCI implementation + setverdict(pass); + } + + control{ + execute(TC_Sem_2709_dynamic_configuration_004()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/27_specifying_attributes/NOTES b/ATS/core_language/27_specifying_attributes/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..3ecc7fd341f12d6f1b0030d95238157b86cfb2d9 --- /dev/null +++ b/ATS/core_language/27_specifying_attributes/NOTES @@ -0,0 +1,4 @@ +Semantics tests of section 27.7 also validate generic attribute handling behavior, +which applies to whole section 27. The reason it is in subsection 27.7, is because +optional attribute matching provides a means of semantic validation through message +loopback port. \ No newline at end of file diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/NegSem_B010101_omitting_values_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/NegSem_B010101_omitting_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1000442451060515b20a499723aafaa6c31955d4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/NegSem_B010101_omitting_values_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1.1, Ensure that the IUT correctly handles template matching of omitted values + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010101_omitting_values_001 { + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record MessageType { + RecordType field1, + SetType field2 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010101_omitting_values_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {a:=1,b:=omit,c:=omit}, //omitting a mandatory field + field2 := {a:=1,b:=omit,c:=omit} + } + + v_testMessage:= { + field1 := {a:=1,b:=omit,c:=true}, + field2 := {a:=1,b:=omit,c:=true} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010101_omitting_values_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0df4dca761cce140ba4d2f8fc18759cac5db5f08 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_001.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1.1, Ensure that the IUT correctly handles template matching of omitted values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010101_omitting_values_001 { + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record MessageType { + RecordType field1, + SetType field2 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010101_omitting_values_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {a:=1,b:=omit,c:=true}, + field2 := {a:=1,b:=omit,c:=true} + } + + v_testMessage:= { + field1 := {a:=1,b:=omit,c:=true}, + field2 := {a:=1,b:=omit,c:=true} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010101_omitting_values_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8339199d8d3ecabbb2fe9e5ea5726478182ae165 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B010101_omitting_values/Sem_B010101_omitting_values_002.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1.1, Ensure that the IUT correctly handles template matching of omitted values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010101_omitting_values_002 { + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record MessageType { + RecordType field1, + SetType field2 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010101_omitting_values_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {a:=1,b:=omit,c:=true}, //value mismatch + field2 := {a:=1,b:=omit,c:=true} + } + + v_testMessage:= { + field1 := {a:=1,b:=2,c:=true}, + field2 := {a:=1,b:=omit,c:=true} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010101_omitting_values_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ecc9e82e1443f4142cda623db3728c3a0e965d1b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_001.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_001 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5387410b8ee0c1f912bdf1a654caf66d5009ea7d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_002.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_002 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 0, //mismatching value + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..470ae65e548bceaa6c9f84f73d83350ab72374eb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_003.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_003 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test strin", //mismatching value + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85cdfa69810f795acea0d484e4540a3a7daf61a1 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_004.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_004 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := false, //mismatching value + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca698f042bc407fb7adddd044cb6adffab262ddb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_005.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_005 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,5}, //mismatching value + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..694360f8927e26b70ba79333d085de9ca0f4022b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_006.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_006 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_006() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_white, //mismatching value + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7dee698e820989f61a8de7fc0bafaae9637cc6cd --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_007.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_007 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_007() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=3,c:=true}, //mismatching value + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..069a831be84f9daa43535b968909dc186bb6659b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_008.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_008 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_008() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=2,b:=1,c:=true}, //mismatching value + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_009.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d37caf7c2efee72fc9949a2c524162eaba0b70f --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_009.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_009 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_009() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {c:=true}, //mismatching value + field9 := {1}, + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_009()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_010.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21738e28e5c40ff74584a4f666201a0619b437c2 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_010.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_010 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0101_matching_specific_value_010() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1,2}, //mismatching value + field10 := {1,2} + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B0101_matching_specific_value_010()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_011.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..579d41bc3c4f1e84ff6b61d718a0e7f6be17ddee --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0101_matching_specific_values/B0101_toplevel/Sem_B0101_matching_specific_value_011.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0101_matching_specific_value_011 { + + type enumerated EnumeratedType {e_black, e_white}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type set SetType { + integer a optional, + integer b optional, + boolean c + } + + type record length (1..2) of integer IntegerList; + + type set length (1..2) of integer IntegerUList; + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + boolean field3, + integer field4[4], + EnumeratedType field5, + RecordType field6, + SetType field7, + UnionType field8, + IntegerList field9, + IntegerUList field10 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0111_matching_specific_value_011() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {2,1} //different order + } + + v_testMessage:= { + field1 := 1, + field2 := "test string", + field3 := true, + field4 := {1,2,3,4}, + field5 := e_black, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1,b:=2,c:=true}, + field8 := {a:=1}, + field9 := {1}, + field10 := {1,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B0111_matching_specific_value_011()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62dea96fcd155f8ec16607ffaa5c00390cb69c76 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_001.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching with all from clause + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +//The type of the template list and the member type of the template in the all from clause shall be compatible. +// Restriction B + +module NegSem_B010201_value_list_001 { + + type set of integer SoI; + + type record MessageType { + integer field1, + charstring field2 + } + template SoI m_SoI := {1,2,3,4}; + template float mw_SoI := (all from m_SoI); //error: m_SoI is integer, mw_SoI is float + + type port loopbackPort message { + inout float + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010201_value_list_001() runs on GeneralComp { + + var float v_testMessage; + v_testMessage:= 2.0; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_SoI) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010201_value_list_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bee56a5376874a9f61ba1bc1940720829ae73d03 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_002.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching with all from clause + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction D,E: Individual members of the template in the all from clause shall not resolve to any of the following matching mechanisms: AnyElementsOrNone, permutation. + +module NegSem_B010201_value_list_002 { + + type set of integer SoI; + + type record MessageType { + integer field1, + charstring field2 + } + template SoI m_SoI := {1,*,4}; + template integer mw_SoI := (all from m_SoI); //error: m_SoI contains AnyElementsOrNone + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010201_value_list_002() runs on GeneralComp { + + var integer v_testMessage; + v_testMessage:= 2; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_SoI) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010201_value_list_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..848a69c3122bea3bda29334ec4dfba0286b11d21 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_003.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching with all from clause + ** @verdict pass reject + ***************************************************/ + +// The following requirements are tested: +// Restriction D,E: Individual members of the template in the all from clause shall not resolve to any of the following matching mechanisms: AnyElementsOrNone, permutation. + +module NegSem_B010201_value_list_003 { + + type record of integer RoI; + + type record MessageType { + integer field1, + charstring field2 + } + template RoI m_RoI := {permutation(0,1,3,*),2}; + template integer mw_RoI := (all from m_RoI); //error: m_RoI contains permutation + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010201_value_list_003() runs on GeneralComp { + + var integer v_testMessage; + v_testMessage:= 2; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_RoI) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010201_value_list_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78e97822f95ab1cb87e1808e370ea9d16031678e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/NegSem_B010201_value_list_004.ttcn @@ -0,0 +1,57 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template list corretly + ** @verdict pass accept reject + ***************************************************/ + +// The following requirements are tested: +// Restriction C: Templates in the template list shall obey the template(present) restriction + +module NegSem_B010201_value_list_004 { + + + type record MessageType { + integer field1, + charstring field2 optional + } + + template(present) MessageType mw_examplePresent := {1, ?}; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010201_value_list_004() runs on GeneralComp { + + var MessageType v_testMessage; + var template(omit) MessageType v_present; + v_present := mw_examplePresent; // error: incorrect + + v_testMessage:= { + field1:= 1, + field2:= "abc" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(v_present) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010201_value_list_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5437570f52c96dc9147ae25338d1ec3ec0c4f91 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_001.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching of listed multiple values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010201_value_list_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010201_value_list_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (1,2), + field2 := ("test string","something else"), + field3 := (e_green,e_black), + field4 := ({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := ({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=2,c:=true}, + field5 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010201_value_list_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..424bd20167bc0bdce5c6027b0736d188435a2e5f --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_002.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching with all from clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +//A template list may contain values, templates obeying the template(present) restriction, and members added by all from clauses. + +module Sem_B010201_value_list_002 { + + type record of integer RoI; + + type record MessageType { + integer field1, + charstring field2 + } + template RoI m_RoI := {1,2,3,4}; + template integer mw_RoI := (all from m_RoI); + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010201_value_list_002() runs on GeneralComp { + + var integer v_testMessage; + v_testMessage:= 2; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_RoI) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010201_value_list_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de8d3514c1d40bf72e14e726cc291fd781292fba --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_003.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template matching with all from clause + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +//A template list may contain values, templates obeying the template(present) restriction, and members added by all from clauses. +module Sem_B010201_value_list_003 { + + type set of integer SoI; + + type record MessageType { + integer field1, + charstring field2 + } + template SoI m_SoI := {1,2,3,4}; + template integer mw_SoI := (all from m_SoI); + + type port loopbackPort message { + inout integer + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010201_value_list_003() runs on GeneralComp { + + var integer v_testMessage; + v_testMessage:= 2; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_SoI) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010201_value_list_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..458224d1723b2484adc2df555ea0eaa826c9fd77 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010201_value_list/Sem_B010201_value_list_004.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template list corretly + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// Restriction C: Templates in the template list shall obey the template(present) restriction + +module Sem_B010201_value_list_004 { + + + type record MessageType { + integer field1, + charstring field2 optional + } + + template(present) MessageType mw_examplePresent := {1, ?}; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010201_value_list_004() runs on GeneralComp { + + var MessageType v_testMessage; + v_testMessage:= { + field1:= 1, + field2:= "abc" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_examplePresent) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010201_value_list_004()); +} + +} \ No newline at end of file diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e94aa4430907c4a3a22b22e1ef191f544bf4242 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010202_complemented_value_list_001 { + + type record MessageType { + integer field1, + RoI field2 + } + + type record of integer RoI; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010202_complemented_value_list_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template RoI m_RoI2 := {2, *, 4}; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(0, all from m_RoI2), // shall cause an error because t_RoI2 contains AnyElementsOrNone + field2 := complement({2, 3, (6..9)}) + } + + v_testMessage:= { + field1 := 0, + field2 := {0,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010202_complemented_value_list_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6dc2a8a7fd351d6d24915cefc8d1668b3b20351b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_002.ttcn @@ -0,0 +1,61 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010202_complemented_value_list_002 { + + type record MessageType { + integer field1, + RoI field2 + } + + type record of integer RoI; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010202_complemented_value_list_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template RoI m_RoI1 := {2, 3, (6..9)}; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(0, 100), + field2 := complement(all from m_RoI1)// causes an error because member type of t_RoI1 (integer) is not compatible + // with the complemented list template type (RoI) + + } + + v_testMessage:= { + field1 := 0, + field2 := {0,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010202_complemented_value_list_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23202d6cc2db196864e2901d474fe4cbc35088bf --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_003.ttcn @@ -0,0 +1,73 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010202_complemented_value_list_003 { + +// type enumerated EnumeratedType {e_black, e_white, e_green}; + +// type record RecordType { +// integer a optional, +// integer b optional, +// boolean c +// } + +// type union UnionType { +// integer a, +// EnumeratedType b, +// boolean c +// } + + type record MessageType { + integer field1, + RoI field2 + } + + type record of integer RoI; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010202_complemented_value_list_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template RoI m_RoI4 := ?; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(0, 100), + field2 := complement(all from m_RoI4)// causes an error because t_RoI4 resolves into a matching mechanism + } + + v_testMessage:= { + field1 := 0, + field2 := {0,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010202_complemented_value_list_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..34717eef542f509ad0e6c3dfc7e1483836ca82e3 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/NegSem_B010202_complemented_value_list_004.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 (updated by STF 527) + ** @version 0.0.2 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value omit + ** @verdict pass accept, ttcn3verdict:fail + ***************************************************/ + +//Restriction e) The complement of a template list shall not match omit. + +module NegSem_B010202_complemented_value_list_004 { + + type record MyRec { + integer field1, + float field2 optional + } + + type port loopbackPort message { + inout MyRec + } + + + type component GeneralComp { + port loopbackPort messagePort + } + + testcase TC_NegSem_B010202_complemented_value_list_004() runs on GeneralComp { + var MyRec v_testMessage := { field1 := 1, field2 := omit}; + var template MyRec mw_matchingTemplate:= { field1 := ?, field2 := complement(1.0, (2.0 .. 5.0)) }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { // won't match as complement never matches omit + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + } + + control { + execute(TC_NegSem_B010202_complemented_value_list_004()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e1b061e512076bffdc93ae696a17c4d99f5f9a8 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_001.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test", + field3 := e_white, + field4 := {a:=1,b:=2,c:=false}, + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5ab4acd479c772b994841f343fd18ce8b18e9b45 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_002.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 2, //mismatching complement in the template + field2 := "test", + field3 := e_white, + field4 := {a:=1,b:=2,c:=false}, + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c863d6a698603ba0a23ec587939bb244db7158f4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_003.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_003 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test string", //mismatching complement in the template + field3 := e_white, + field4 := {a:=1,b:=2,c:=false}, + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f52791fcc805e30edf476e3d77bf2f5113351707 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_004.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_004 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test ", + field3 := e_green, //mismatching complement in the template + field4 := {a:=1,b:=2,c:=false}, + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..556cf9a9160c400359610c6d69f126635d9c425e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_005.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_005 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test ", + field3 := e_white, + field4 := {a:=1,b:=2,c:=true}, //mismatching complement in the template + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..650d864b6e763bafab198834253278a9e11335a6 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_006.ttcn @@ -0,0 +1,78 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_006 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_006() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(1,2), + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test ", + field3 := e_white, + field4 := {a:=1,b:=2,c:=false}, + field5 := {b:=e_white} //mismatching complement in the template + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a7ce041f97905ea4a3bbcadf547cf50b5e4f488b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_007.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 470 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010202_complemented_value_list_007 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5 + } + + type record of integer RoI; + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_007() runs on GeneralComp { + + var MessageType v_testMessage; + + template RoI m_RoI1 := {1, 2, (6..9)}; + + template MessageType mw_matchingTemplate:= + { + field1 := complement(all from m_RoI1, 100), // fine as items from m_RoI1 resolve to integer templates + field2 := complement("test string","something else"), + field3 := complement(e_green,e_black), + field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}), + field5 := complement({a:=1},{b:=e_white}) + } + + v_testMessage:= { + field1 := 0, + field2 := "test ", + field3 := e_white, + field4 := {a:=1,b:=2,c:=false}, + field5 := {a:=2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9595b1823f72578de5c3db7e9f28e04d0c173a02 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010202_complemented_value_list/Sem_B010202_complemented_value_list_008.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value omit + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction e) The complement of a template list shall not match omit. + +module Sem_B010202_complemented_value_list_008 { + +type record MyRec{ + integer field1, + float field2 optional + } + + type port loopbackPort message { + inout MyRec + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010202_complemented_value_list_008() runs on GeneralComp { + + var MyRec v_testMessage; + + template MyRec mw_matchingTemp:={field1:=1,field2:=omit}; + + template MyRec mw_matchingTemplate:=complement(mw_matchingTemp); + + + v_testMessage:= {field1:=11,field2:=omit}; // correct, field2 is omit and is not matched + + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010202_complemented_value_list_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22859cd54f852caa897dcf8f81adb20681c84b0a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.3, Ensure that the IUT correctly handles template matching of ? values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010203_any_value_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5, + RecordType field6, + UnionType field7 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010203_any_value_001() runs on GeneralComp { + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := ?, + field3 := ?, + field4 := ?, + field5 := ?, + field6 := {a:=1,b:=?,c:=true}, + field7 := {a:=?} + } + + var MessageType v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010203_any_value_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..79fbe5801fd45690eeda8d822ac048bd8c793631 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010203_any_value/Sem_B010203_any_value_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.3, Ensure that the IUT correctly handles template matching of ? values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010203_any_value_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5, + RecordType field6, + UnionType field7 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010203_any_value_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := ?, + field3 := ?, + field4 := ?, + field5 := ?, + field6 := {a:=1,b:=?,c:=true}, //omitted value does not match ? + field7 := {a:=?} + } + + v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=omit,c:=true}, + field7 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010203_any_value_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80078c7accb7f8f109c439b325de5aac62c6b211 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_001.ttcn @@ -0,0 +1,73 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that the IUT correctly handles template matching of * values + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010204_any_value_or_none_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + EnumeratedType field3, + RecordType field4, + UnionType field5, + RecordType field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010204_any_value_or_none_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := *, // * is used on non-optional fields + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := {a:=1,b:=*,c:=true} + } + + v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=omit,c:=true} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010204_any_value_or_none_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2faa8df6798fea335c5a73643e4bcd87974e0f4d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/NegSem_B010204_any_value_or_none_002.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that the IUT correctly handles template matching of * values + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010204_any_value_or_none_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1 optional, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6, + UnionType field7 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010204_any_value_or_none_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := *, + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := {a:=1,b:=*,c:=true}, + field7 := {a:=*} //use of * on a union element + } + + v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=omit,c:=true}, + field7 := {a:=1} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010204_any_value_or_none_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4aae6445b432ac80bcf91a184afc03421db04abe --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_001.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that the IUT correctly handles template matching of * values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010204_any_value_or_none_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1 optional, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010204_any_value_or_none_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := *, + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := {a:=1,b:=*,c:=true} + } + + v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=omit,c:=true} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010204_any_value_or_none_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a50677e78ab9a52e5af28b88307ab37934767fe --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that AnyValueOrNone can be assigned to top-level template + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// It can be assigned to templates of any type as a whole. + +module Sem_B010204_any_value_or_none_002 { + + template integer t_anyOrNone := *; // top-level static template + + + type component GeneralComp { + } + + function f(in template integer p1) { + } + + testcase TC_Sem_B010204_any_value_or_none_002() runs on GeneralComp { + + var template integer vt_anyOrNone := *; // top-level template variable + f(*); // top-level template parameter + setverdict(pass); + } + + control{ + execute(TC_Sem_B010204_any_value_or_none_002()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f691dfd1c656c3ca9ca93d72ab6de2cd8c4bb5c --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_003.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that AnyValueOrNone can be used for matching optional fields + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// At the time of matching, it shall be applied to optional fields of record and set +// templates only. + +module Sem_B010204_any_value_or_none_003 { + + type set Set1 { + integer field1, + integer field2 optional + } + template integer t_anyOrNone := *; // top-level static template + + type component GeneralComp { + } + + testcase TC_Sem_B010204_any_value_or_none_003() runs on GeneralComp { + var Set1 v_val := { field1 := 5, field2 := 23 }; + if (match(v_val.field2, t_anyOrNone)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_B010204_any_value_or_none_003()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4318f5502fb07fba7a28b5f6647735ff2093b9e3 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that AnyValueOrNone can be used for matching non-optional value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// At the time of matching, it shall be applied to optional fields of record and set +// templates only. + +//formerly: NegSem_B010204_any_value_or_none_003 + +module Sem_B010204_any_value_or_none_004 { + + type set Set1 { + integer field1, + integer field2 optional + } + template Set1 t_anyOrNone := *; // top-level static template + + type component GeneralComp { + } + + testcase TC_Sem_B010204_any_value_or_none_004() runs on GeneralComp { + var Set1 v_val := { field1 := 5, field2 := 23 }; + if (match(v_val, t_anyOrNone)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_B010204_any_value_or_none_004()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6bc1b179953aa717c8b627e393809723b6885ddf --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010204_any_value_or_none/Sem_B010204_any_value_or_none_005.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.4, Ensure that AnyValueOrNone can be used for matching compulsory fields + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// At the time of matching, it shall be applied to optional fields of record and set +// templates only. + +//formerly: NegSem_B010204_any_value_or_none_004 + +module Sem_B010204_any_value_or_none_005 { + + type set Set1 { + integer field1, + integer field2 optional + } + template integer t_anyOrNone := *; // top-level static template + + type component GeneralComp { + } + + testcase TC_Sem_B010204_any_value_or_none_005() runs on GeneralComp { + var Set1 v_val := { field1 := 5, field2 := 23 }; + if (match(v_val.field1, t_anyOrNone)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_B010204_any_value_or_none_005()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80b55c6da97d721ee7b82c97f8ec72258e462f97 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_001.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010205_value_range_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + EnumeratedType field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010205_value_range_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := (e_black..e_white), //attempt to use range on enumerated type + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := e_black, + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010205_value_range_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..22947893f303ec90b6fff4be01544716ea491df0 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_002.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010205_value_range_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010205_value_range_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (2..0), //boundaries in wrong order + field2 := ("aaa".."fff"), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010205_value_range_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13b6533ee398ccc50c055f81e03ba0744e0b74af --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/NegSem_B010205_value_range_003.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010205_value_range_003 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010205_value_range_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("fff".."aaa"), //boundaries in wrong order + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010205_value_range_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82201af29257306b6e6e8472e5cf6f7e679a3ef7 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_001.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f56f3bc6181eee638deb62dcfb475e1f26042e33 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_002.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..1), //value is out of range + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5230db343ad28a46cb2aaaa41f3d48c4843e5b66 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_003.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_003 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..1),c:=true}, //value is out of range + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fc56d843a5d88475f6fa447b6d66e39ca53beea --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_004.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_004 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + float a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(1.000001 .. 2.0)} //float value is out of range + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1.0} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44ddc64057b0165b37ab2768cf9679750325dbbb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_005.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_005 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + float a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("a".."f") length (3), //character is out of range + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(1.0 .. 2.0)} + } + + v_testMessage:= { + field1 := 2, + field2 := "akc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1.0} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9a730a4719feeb360a85acf547033eefdc91214 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_006.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_006 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + float a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_006() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2), + field2 := ("a".."f") length (3), //character is out of range because of an empty character + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(1.0 .. 2.0)} + } + + v_testMessage:= { + field1 := 2, + field2 := "ab", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1.0} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f1b053f2584b6946c4c1874ed237b4457496c133 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_007.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_007 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_007() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..!2), //value is out of range because of exclusive upper boundary + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 2, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e8e4623644f8f4985d175178c9d4602c9bc25c8d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010205_value_range/Sem_B010205_value_range_008.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 433 + ** @version 0.0.1 + ** @purpose 1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010205_value_range_008 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2, + RecordType field3, + UnionType field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010205_value_range_008() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (!0..2), //value is out of range because of exclusive lower boundary + field2 := ("a".."f") length (3), + field3 := {a:=1,b:=(0..2),c:=true}, + field4 := {a:=(0..2)} + } + + v_testMessage:= { + field1 := 0, + field2 := "abc", + field3 := {a:=1,b:=2,c:=true}, + field4 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010205_value_range_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5dde62be08be5881714bbb8451121682b6a10a61 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010206_superset_001 { + type record MessageType { + record of integer field1 // superset definition is only allowed over set of + } + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010206_superset_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := {field1 := superset(1, 2)} + + v_testMessage := {field1 := {1, 3, 2}}; + + messagePort.send(v_testMessage); + setverdict(pass); + } + control { + execute(TC_NegSem_B010206_superset_001()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a00b97772d8e7a9339f9657f2a985e32ee240786 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_002.ttcn @@ -0,0 +1,40 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010206_superset_002 { + type set SetType { + integer a optional, integer b optional, integer c optional + } + + type record MessageType { + SetType field1 // superset definition is only allowed over set of + } + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010206_superset_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := {field1 := superset(1, 2)} + + v_testMessage := {field1 := {1, 3, 2}}; + + messagePort.send(v_testMessage); + setverdict(pass); + } + control { + execute(TC_NegSem_B010206_superset_002()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b50b9f6f4e61fb55efc6b90148e1029135a3956 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:fail + ***************************************************/ + +module NegSem_B010206_superset_003 { + type set of integer SoI; + + type SoI MessageType; + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010206_superset_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := superset(1,10,3); + + v_testMessage := {1}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { // mismatch + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + + } + control { + execute(TC_NegSem_B010206_superset_003()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d256d4ae212e557d15c9907c8058883f24514a7a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010206_superset_004 { + type set of integer SoI; + + type SoI MessageType; + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010206_superset_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := superset(1,10,3) length (2..5); //error:minimal length allowed by the length attribute shall not be less than the number of the elements in the SuperSet + + v_testMessage := {1,11,5}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + + } + control { + execute(TC_NegSem_B010206_superset_004()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2f6f9c1f235a132422776b133e5e39f5aec6d1a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_005.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010206_superset_005 { + + type set of integer SoI; + type record of integer RoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010206_superset_005() runs on GeneralComp { + + var SoI v_testMessage; + + template RoI Template:= {omit}; + + template SoI mw_matchingTemplate:= superset(all from Template); //error + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010206_superset_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3749d177310ab61b19d5db1b0a9c1936347d3969 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_006.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010206_superset_006 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010206_superset_006() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= superset(1,2); + + template SoI mw_matchingTemplate:= subset(all from Template); //error + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010206_superset_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..12c96b192d561114bc12da30ee2dc010825bcbbb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_007.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010206_superset_007 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010206_superset_007() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= subset(1,2); + + template SoI mw_matchingTemplate:= superset(all from Template); //error + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010206_superset_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c86517abb4ef2817f5c6753d8afc542dbccd251 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_008.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010206_superset_008 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010206_superset_008() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {*}; + + template SoI mw_matchingTemplate:= superset(all from Template); //error + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010206_superset_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_009.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b4d44351b46e97e36b4c42fbe3aeb98c211a720 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/NegSem_B010206_superset_009.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010206_superset_009 { + type record of integer RoI; + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010206_superset_009() runs on GeneralComp { + + var SoI v_testMessage; + + template RoI Template:= {permutation(1,2,3)}; + + template SoI mw_matchingTemplate:= superset(all from Template); //error + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010206_superset_009()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb93e0aefe2a8658b03d8acd1b5d8d3a34e12f26 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_001.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010206_superset_001 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := superset(1,2) + } + + v_testMessage:= { + field1 := {1,3,2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..678f9c6d8cee9dd842e671655da8ebabec463a70 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_002.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010206_superset_002 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := superset(1,2) //no match for element 2 + } + + v_testMessage:= { + field1 := {1,3,4} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7efe36cd608910a28a0f36cb3bcaa66ecee3a97 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_003.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010206_superset_003 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := superset(1,2) //no match for element 2 + } + + v_testMessage:= { + field1 := {1,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d03b9523bda636cb589e05664119a34dd76c3a19 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_004.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction c) +/*The member type of the set of associated with the SuperSet template and the member type of the template in +the all from clause shall be compatible.*/ + +module Sem_B010206_superset_004 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_004() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {1,2}; + template SoI mw_matchingTemplate:= superset(all from Template); + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d36fb29a051b7b2b498437a9ce631f0a0f5b904e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_005.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module Sem_B010206_superset_005 { + + type set of integer SoI; + template SoI Template:= {1,2} length(1..10); + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_005() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI mw_matchingTemplate:= superset(all from Template); + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a699154e7460edc9441cd869e9c4f56ac10b25b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_006.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module Sem_B010206_superset_006 { + + type set of integer SoI; + template SoI Template:= {1,2} ifpresent; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_006() runs on GeneralComp { + + var SoI v_testMessage; + + + template SoI mw_matchingTemplate:= superset(all from Template); + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cd5a17ab13d85278d1667ab18c96b48447cc2dc4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_007.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction e) +/*The individual members of the SuperSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, the individual members shall not resolve to AnyValueOrNone and individual +elements of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module Sem_B010206_superset_007 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_007() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {1,?}; + template SoI mw_matchingTemplate:= superset(all from Template); + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a653521e8e1e1611cb67241bd9081c8d48d9c71 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010206_superset/Sem_B010206_superset_008.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of superset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + //Restriction c) +/*The member type of the set of associated with the SuperSet template and the member type of the template in +the all from clause shall be compatible.*/ + +module Sem_B010206_superset_008 { + + type set of integer SoI; + type record of integer RoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010206_superset_008() runs on GeneralComp { + + var SoI v_testMessage; + + template RoI Template:= {1,2}; + template SoI mw_matchingTemplate:= superset(all from Template); //Template is a record of integers + + + v_testMessage:={1,2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010206_superset_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..55bb25349bd109fb41e72a08b9603414cc5b1ff5 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_001.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass reject + ***************************************************/ +module NegSem_B010207_subset_001 { + type record MessageType { + record of integer + field1 // subset definition is only allowed over set of + } + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010207_subset_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := {field1 := subset(1, 2)} + + v_testMessage := {field1 := {1}}; + + messagePort.send(v_testMessage); + setverdict(pass); + } + control { + execute(TC_NegSem_B010207_subset_001()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef870f0fb45136940248be2c3842ac26cc3984c8 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_002.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010207_subset_002 { + + type set SetType { + integer a optional, + integer b optional, + integer c optional + } + + type record MessageType { + SetType field1 //subset definition is only allowed over set of + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := subset(1,2) + } + + v_testMessage:= { + field1 := {1} + } + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010207_subset_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..987e4dd0a41ea5dcd6f469ea454479766887ffa9 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_003.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction f:If the length matching attribute is attached to the SubSet, the maximum length allowed by the length attribute +//shall not exceed the number of the elements in the SubSet. + +module NegSem_B010207_subset_003{ + type set of integer SoI; + + type SoI MessageType; + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010207_subset_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := subset(1,10,3) length (1..5); //error:the upper bound of length attribute contradicts to the maximum number of + // elements imposed by the subset argument + + v_testMessage := {1,10,3}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + + } + control { + execute(TC_NegSem_B010207_subset_003()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..360dcaeb11e2fd3312c4ee0f5b4aaca4e0c7db67 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_004.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, individual members shall not resolve to AnyValueOrNone and individual fields of +the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010207_subset_004 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_004() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {omit}; + + template SoI mw_matchingTemplate:= subset(all from Template); //error: Compulsory item cannot be omitted. + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010207_subset_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82f722feaa16abffbd4b150cf1694471df7d9d43 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_005.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, individual members shall not resolve to AnyValueOrNone and individual fields of +the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010207_subset_005 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_005() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= superset(3,4); + + template SoI mw_matchingTemplate:= subset(all from Template); //error: The "all from" clause contains a matching mechanism. + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010207_subset_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28b4231fcb0c08ae62f982e2bfffce6d1144754e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_006.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, individual members shall not resolve to AnyValueOrNone and individual fields of +the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010207_subset_006 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_006() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= subset(3,4); + + template SoI mw_matchingTemplate:= subset(all from Template); //error: The "all from" clause contains a matching mechanism. + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010207_subset_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0da038e528aac7c4afdb7e7bfb342e77c7b6de67 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_007.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, individual members shall not resolve to AnyValueOrNone and individual fields of +the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010207_subset_007 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_007() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {*}; + + template SoI mw_matchingTemplate:= subset(all from Template); //error: forbidden matching mechanism. + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010207_subset_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ca7fcb9d8bb391a9a501bbf31113537544ec1de7 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/NegSem_B010207_subset_008.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions + ** @verdict pass reject + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms omit, SuperSet, SubSet and the matching attributes (length restriction +and ifpresent). In addition, individual members shall not resolve to AnyValueOrNone and individual fields of +the template in the all from clause shall not resolve to AnyElementsOrNone or permutation.*/ + +module NegSem_B010207_subset_008 { + + type set of integer SoI; + type record of integer RoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010207_subset_008() runs on GeneralComp { + + var SoI v_testMessage; + + template RoI Template:= {permutation(1,2,4)}; + + template SoI mw_matchingTemplate:= subset(all from Template); //error: forbidden matching mechanism. + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010207_subset_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c9bc079e4921836c69ae510e0c42b308b2656c02 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_001.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010207_subset_001 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := subset(1,2) + } + + v_testMessage:= { + field1 := {2} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6caa1b8323bb3319a81004085c9d569b0b3f649a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_002.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010207_subset_002 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := subset(1,2) //no match for subset elements + } + + v_testMessage:= { + field1 := {3} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ff69f331e5942ac544814a4bb1a50282191d16bc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_003.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of superset definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010207_subset_003 { + + + type record MessageType { + set of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := subset(1,2) //more elements than subset list + } + + v_testMessage:= { + field1 := {1,2,3} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a337ef7916091d1c21758683b4cd7540a5b736c4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_004.ttcn @@ -0,0 +1,49 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction c) The member type of the set of type associated with the SubSet and the member type of the template in the all from clause shall be compatible. + +module Sem_B010207_subset_004 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_004() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {1,2}; + + template SoI mw_matchingTemplate:= subset(all from Template); //subset(1,2); + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65407e51522656ec3f8dadd732585f6c81973d8d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_005.ttcn @@ -0,0 +1,52 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms length restriction and ifpresent).*/ + +module Sem_B010207_subset_005 { + + type set of integer SoI; + template SoI Template:= {1,2} length(1..5); + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_005() runs on GeneralComp { + + var SoI v_testMessage; + + + + template SoI mw_matchingTemplate:= subset(all from Template); //subset(1,2); + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cfd152892b168283d6d94a2d73f0373e71c807cc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_006.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction e) +/*The individual members of the SubSet's argument and the elements of the template in the all from clause +shall not be the matching mechanisms length restriction and ifpresent).*/ + +module Sem_B010207_subset_006 { + + type set of integer SoI; + + template SoI Template:= {1,2} ifpresent; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_006() runs on GeneralComp { + + var SoI v_testMessage; + + + + template SoI mw_matchingTemplate:= subset(all from Template); //subset(1,2); + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2c464760a6c313e7ce426fa8633e69031504bfe7 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_007.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction e) +/*individual members shall not resolve to AnyValueOrNone and individual fields of the template in the all from clause shall not resolve to AnyElementsOrNone or permutation..*/ + +module Sem_B010207_subset_007 { + + type set of integer SoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_007() runs on GeneralComp { + + var SoI v_testMessage; + + template SoI Template:= {1,?}; + + template SoI mw_matchingTemplate:= subset(all from Template); + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ce232f432fe6a4c44105cd966bdf177bd59bf36 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010207_subset/Sem_B010207_subset_008.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.7, Ensure that the IUT correctly handles template matching of subset definition + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction c) + +module Sem_B010207_subset_008 { + + type set of integer SoI; + type record of integer RoI; + + type port loopbackPort message { + inout SoI + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010207_subset_008() runs on GeneralComp { + + var SoI v_testMessage; + + template RoI Template:= {1,?}; + + template SoI mw_matchingTemplate:= subset(all from Template); //Template is a record of integers + + v_testMessage:={2}; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010207_subset_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53e8cacdc293676bead03deb162cd59886d06802 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010208_omit_value_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6 optional, + UnionType field7 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010208_omit_value_001() runs on GeneralComp { + + template MessageType mw_matchingTemplate:= + { + field1 := omit,// causes an error as field1 is mandatory + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := *, + field7 := * + } + + var MessageType v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit, + field4 := omit, + field5 := omit, + field6 := omit, + field7 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010208_omit_value_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5539e8355ca7379d03bcb9c9d67d71b70fe8efb4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSem_B010208_omit_value_002.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010208_omit_value_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6 optional, + UnionType field7 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010208_omit_value_002() runs on GeneralComp { + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := {a:=1,b:=2,c:=omit},// causes an error as c field is mandatory + field7 := * + } + + var MessageType v_testMessage:= { + field1 := 2, + field2 := "test string", + field3 := e_black, + field4 := {a:=1,b:=omit,c:=true}, + field5 := {a:=1}, + field6 := {a:=1,b:=2,c:=true}, + field7 := {a:=1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_NegSem_B010208_omit_value_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSyn_B010208_omit_value_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSyn_B010208_omit_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7734373d547289dfc303665086d767a5d60e5053 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/NegSyn_B010208_omit_value_001.ttcn @@ -0,0 +1,19 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass reject, noexecution + ***************************************************/ +// Restriction A: It can be assigned to templates of any type as a whole or to optional fields of set or record templates. + +module NegSyn_B010208_omit_value_001 { + + type integer My_Int; + + type component GeneralComp {} + +testcase TC_NegSyn_B010208_omit_value_001() runs on GeneralComp { + var My_Int v_int:= omit; // not allowed. It can be assigned to templates of any type as a whole or to optional fields of set or record templates +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c78e5195d60f0b3c29bfc4537d2d86e03781fdcc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010208_omit_value_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6 optional, + UnionType field7 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010208_omit_value_001() runs on GeneralComp { + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := omit, + field3 := omit, + field4 := omit, + field5 := omit, + field6 := omit, + field7 := omit + } + + var MessageType v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit, + field4 := omit, + field5 := omit, + field6 := omit, + field7 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010208_omit_value_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31159d966e6148e889d0c6d894e59a8959a0bd0b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010208_omit_value_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1, + charstring field2 optional, + EnumeratedType field3 optional, + RecordType field4 optional, + UnionType field5 optional, + RecordType field6 optional, + UnionType field7 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010208_omit_value_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := *, + field3 := *, + field4 := *, + field5 := *, + field6 := {a:=1,b:=omit,c:=true}, //omits the optional field + field7 := * + } + + v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit, + field4 := omit, + field5 := omit, + field6 := {a:=1,b:=omit,c:=true}, + field7 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010208_omit_value_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d950890ed77c799a17e8a791837d89d3b80be15 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_003.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010208_omit_value_003 { + + type record MessageType { + integer field1, + MyRecordof field2 optional, + boolean field3 optional + } + + type record of integer MyRecordof; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010208_omit_value_003() runs on GeneralComp { + + var MessageType v_testMessage; + var boolean v_boolean; + template MyRecordof mw_MyRecofTemplate := omit; // this assignment is allowed + template boolean mw_MyBoolTemplate := omit; // this assignment is allowed + + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := mw_MyRecofTemplate, + field3 := mw_MyBoolTemplate + } + + v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010208_omit_value_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab28d430183326402d8a4d4c3558dc488fb829ea --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_004.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010208_omit_value_004 { + + type record MessageType { + integer field1, + MyRecordof field2 optional, + boolean field3 optional + } + + type record of integer MyRecordof; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010208_omit_value_004() runs on GeneralComp { + + var MessageType v_testMessage; + var boolean v_boolean; + template MyRecordof mw_MyRecofTemplate := omit; // this assignment is allowed + template boolean mw_MyBoolTemplate := omit; // this assignment is allowed + + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := mw_MyRecofTemplate, + field3 := mw_MyBoolTemplate + } + + v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + v_boolean := match({2,omit,omit},mw_matchingTemplate);// matches and returns true + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010208_omit_value_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1e797ea16b4d4b4dcc0e6bb678c44b94006b4a6 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_005.ttcn @@ -0,0 +1,70 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles template matching of omit values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + + +// formerly: NegSem_B010208_omit_value_003 + +module Sem_B010208_omit_value_005 { + + type record MessageType { + integer field1, + MyRecordof field2 optional, + boolean field3 optional + } + + type record of integer MyRecordof; + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010208_omit_value_005() runs on GeneralComp { + + var MessageType v_testMessage; + var boolean v_boolean; + template MyRecordof mw_MyRecofTemplate := omit; // this assignment is allowed + template boolean mw_MyBoolTemplate := omit; // this assignment is allowed + + + template MessageType mw_matchingTemplate:= + { + field1 := ?, + field2 := mw_MyRecofTemplate, + field3 := mw_MyBoolTemplate + } + + v_testMessage:= { + field1 := 2, + field2 := omit, + field3 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + v_boolean := match({},mw_MyRecofTemplate); // does not match and returns false + if(v_boolean == false){ + setverdict(pass); + } + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010208_omit_value_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9d232382cc5ee2b78d069d96d996da2a7125024b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn @@ -0,0 +1,67 @@ +/*************************************************** + ** @author STF 487 (updated by STF 521) + ** @version 0.0.2 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction a) +/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, +charstring and universal charstring types.*/ + +module Sem_B010209_decoded_content_001 { + + type record MessageType { + bitstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010209_decoded_content_001() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template MessageType mw_matchingTemplate:= { + payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B} + } + + v_testMessage:= { + field1 := 10, + field2 := '1001'B + } + + Message.payload := encvalue(v_testMessage); //encode message to payload + + + + + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_B010209_decoded_content_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e9d3e1260d0a46f2c7c062b3f113be2a970ddef --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction a) +/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, +charstring and universal charstring types.*/ + +module Sem_B010209_decoded_content_002 { + + type record MessageType { + hexstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010209_decoded_content_002() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template MessageType mw_matchingTemplate:= { + payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B} + } + + v_testMessage:= { + field1 := 10, + field2 := '1001'B + } + + Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload, hexstring + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_B010209_decoded_content_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..649d209bccc19472e14a317e5a76b3e762102c02 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 487 (updated by STF 512) + ** @version 0.0.2 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction a) +/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, +charstring and universal charstring types.*/ + +module Sem_B010209_decoded_content_003 { + + type record MessageType { + octetstring payload + } + + type record Mymessage { + integer field1, + bitstring field2 optional + } + + + type port loopbackPort message{inout MessageType}; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010209_decoded_content_003() runs on GeneralComp { + var bitstring v_enc; + var Mymessage v_testMessage; + var MessageType Message; + template MessageType mw_matchingTemplate := { + payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B} + } + + v_testMessage:= { + field1 := 10, + field2 := '1001'B + } + + Message.payload := bit2oct(encvalue(v_testMessage)); //encode message to payload, octetstring + + + + + + + messagePort.send(Message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } + +} + +control{ + execute(TC_Sem_B010209_decoded_content_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f368084c5ca54ddd0117dbadb23a89a23ce94d0 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction a) +/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, +charstring and universal charstring types.*/ + + +module Sem_B010209_decoded_content_004 { + + type record MessageType { + charstring payload + } + + type integer MyInt with { encode "32bit" } + + type port loopbackPort message{inout MessageType}; + + + type component GeneralComp { + port loopbackPort messagePort + } + + const MyInt c_input := 1633837665; + + template MessageType mw_matchingTemplate:= { + payload := decmatch MyInt:c_input + } + + testcase TC_Sem_B010209_decoded_content_004() runs on GeneralComp { + var MessageType v_message; + + v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring + + messagePort.send(v_message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail,mw_matchingTemplate); + } + } + } + + control{ + execute(TC_Sem_B010209_decoded_content_004()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4805f8d424d3f2a6a1cf2f34d54647cd56a343b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn @@ -0,0 +1,55 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +//Restriction a) +/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, +charstring and universal charstring types.*/ + + +module Sem_B010209_decoded_content_005 { + + type record MessageType { + universal charstring payload + } + + type integer MyInt with { encode "32bit" } + + type port loopbackPort message{inout MessageType}; + + type component GeneralComp { + port loopbackPort messagePort + } + + const MyInt c_input := 1633837665; + + template MessageType mw_matchingTemplate:= { + payload := decmatch MyInt:c_input + } + + testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp { + var MessageType v_message; + + v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring + + messagePort.send(v_message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail,mw_matchingTemplate); + } + } + + } + + control{ + execute(TC_Sem_B010209_decoded_content_005()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010210_enumerated_value_list/Sem_B010210_enumerated_value_list_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010210_enumerated_value_list/Sem_B010210_enumerated_value_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f0389ffc2e6673b03d87ca62007cf96748c8c18 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010210_enumerated_value_list/Sem_B010210_enumerated_value_list_001.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.2.10, Ensure that the IUT correctly handles enum matching + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +/*The template matches only those enumerated values of the same name where the associated integer values is matched by at least one of the integer templates.*/ + + +module Sem_B010210_enumerated_value_list_001 { + + + type enumerated MyFirstEnum { + First_enum(0), Second_enum(1), other_enum(2..200) + } + + type port messagePortType message { + inout MyFirstEnum; + } + + template integer m_Int :=(10..100); + + + type component GeneralComp { + port messagePortType messagePort; + } + + + testcase TC_Sem_B010210_enumerated_value_list_001() runs on GeneralComp { + + template MyFirstEnum mw_matchingTemplate:= other_enum(m_Int); // matches other_enum(10..100) + + var MyFirstEnum v_message := other_enum(11); + + messagePort.send(v_message); //send message + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail, mw_matchingTemplate); + } + } + } + + control{ + execute(TC_Sem_B010210_enumerated_value_list_001()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a29658e04f1b35e12767cda8425f1916326a32e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_001 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test s?ring", + field2 := '10???'B, + field3 := '8?A?C'H + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c114e0991dcc679388fffa2404f177d4dbdb5171 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_002.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_002 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test s?ring", //attempting to match a missing character + field2 := '10???'B, + field3 := '8?A?C'H + } + + v_testMessage:= { + field1 := "test sring", + field2 := '10101'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e433083f45299a1f4200bb80b9e027e37d7daf36 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_003.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_003 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := "test string", + field2 := '10???'B, + field3 := '8?A?C'H //attempting to match several characters + } + + v_testMessage:= { + field1 := "test sring", + field2 := '10101'B, + field3 := '89ABBC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c350dd032f77716af9461b096ed12f221d2b1333 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_004.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_004 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := "test string", + field2 := '10???'B, //mismatching string lengths + field3 := '8?A?C'H + } + + v_testMessage:= { + field1 := "test sring", + field2 := '10'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c9a7a558399421530dfe741267bb7a3ca5a36a8 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_005.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_005 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := "test s?ring", //literally interpreted string without the pattern keyword + field2 := '10???'B, + field3 := '8?A?C'H + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6e7e97b5c7681c4a1cecda6f1061129931d4315 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_006.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_006 { + + + type record MessageType { + record of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_006() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {8,?,10,?,12} + } + + v_testMessage:= { + field1 := {8,9,10,11,12} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..08927085bffb7ef20d1ecff28a05481aa7e5eeca --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_007.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_007 { + + + type record MessageType { + record of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_007() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {8,?,10,?,12} + } + + v_testMessage:= { + field1 := {8,9,10,12} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_007()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85c0a178d7fc0bdaa2da5da611ac8a26f23441fa --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_008.ttcn @@ -0,0 +1,53 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.1, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010301_any_element_008 { + + + type record MessageType { + record of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010301_any_element_008() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {8,?,?,12} + } + + v_testMessage:= { + field1 := {8,9,10,11,12} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010301_any_element_008()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ae45f55a2171efdb616fed59ca1cb6a298bfb746 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.2, Ensure that the IUT correctly handles template matching of * symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010302_any_number_of_elements_or_none_001 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010302_any_number_of_elements_or_none_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test s*g", + field2 := '10*'B, + field3 := '89*ABC'H + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010302_any_number_of_elements_or_none_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aec2021ea225208f2f4533bbf8f235c414fe9bbd --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_002.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.2, Ensure that the IUT correctly handles template matching of * symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010302_any_number_of_elements_or_none_002 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010302_any_number_of_elements_or_none_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := "test s*g", //literally interpreted string without the pattern keyword + field2 := '10*'B, + field3 := '89*ABC'H + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010302_any_number_of_elements_or_none_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bc7603683320be2527fc905375e49fd61a62a1f2 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010302_any_number_of_elements_or_none/Sem_B010302_any_number_of_elements_or_none_003.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.2, Ensure that the IUT correctly handles template matching of * symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010302_any_number_of_elements_or_none_003 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010302_any_number_of_elements_or_none_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := {8,*,10,*,12}, + field2 := {8,*,10,*,12}, + field3 := {8,*,10,*,12} + } + + v_testMessage:= { + field1 := {8,9,10,11,12}, + field2 := {8,9,10,12}, + field3 := {8,9,9,10,10,11,12} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010302_any_number_of_elements_or_none_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9e1d647e83111e3fe27fc3c2db2327e8c7c5d36e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010303_permutation_001 { + type record MessageType { + set of integer field1, + // permutation can only be applied to a record of type + set of integer field2, + set of integer field3, + set of integer field4 + } + + type port loopbackPort message { + inout MessageType; + } + + + type component GeneralComp { + port loopbackPort messagePort; + } + + testcase TC_NegSem_B010303_permutation_001() runs on GeneralComp { + timer t := 1.0; + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate := { + field1 := {permutation(1, 2, 3), 5}, + field2 := {permutation(1, 2, ?), 5}, + field3 := {permutation(1, 2, 3), *}, + field4 := {permutation((1, 2, 3), 2, 3), 5} + } + + v_testMessage := { + field1 := {2, 1, 3, 5}, + field2 := {2, 1, 8, 5}, + field3 := {3, 2, 1, 8, 8}, + field4 := {3, 2, 2, 5} + }; + + t.start; + + messagePort.send(v_testMessage); + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] t.timeout { + setverdict(fail); + } + } + } + control { + execute(TC_NegSem_B010303_permutation_001()); + } +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27ba448a076fb62a33c132b9f10c4fadba21f584 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_002.ttcn @@ -0,0 +1,35 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that all from operand can be a record of or set of only + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Besides specifying all individual values, it is possible to add all elements of +// a record of or set of template into permutations using an all from clause. + +module NegSem_B010303_permutation_002 { + + type record of integer RoI; + template integer t_source := 2; + // t_source is not a record of or set of -> an error expected + template RoI t_perm1 := { permutation ( 5, all from t_source ) }; + + type component GeneralComp { + } + + testcase TC_NegSem_B010303_permutation_002() runs on GeneralComp { + if (match({ 2, 5 }, t_perm1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_B010303_permutation_002()); + } + +} + diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0cb79748bd658851f1f01add1d44fe92bb9a1818 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_003.ttcn @@ -0,0 +1,34 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that type restriction for permutation elements is applied + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Each individual member listed in the permutation shall be of the type replicated +// by the record of type. + +module NegSem_B010303_permutation_003 { + + type record of integer RoI; + + template RoI t_perm1 := { permutation ( 5, 2.0 ) }; // float value is not compatible + + + type component GeneralComp { + } + + testcase TC_NegSem_B010303_permutation_003() runs on GeneralComp { + if (match({ 2, 5 }, t_perm1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_B010303_permutation_003()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a1e8b20f67f6d2d365db55a286a2aa109558270 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_004.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that type restriction for all from clause in permutation is applied + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The member type of the permutation and the member type of the template in the all +// from clause shall be compatible. + +module NegSem_B010303_permutation_004 { + + type record of float RoF; + type record of integer RoI; + + template RoF t_source := { ?, * } + // float value is not compatible with integer (even though the actual symbols are + // generic and would work with integer elements too) + template RoI t_perm1 := { permutation ( 3, all from t_source ) }; + + + type component GeneralComp { + } + + testcase TC_NegSem_B010303_permutation_004() runs on GeneralComp { + if (match({ 2, 3 }, t_perm1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_B010303_permutation_004()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..90f2b0a96a5c29ee893d239c9b974030459178d1 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_005.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Verify restriction on individual members of all from operand in permutation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// The template in the all from clause as a whole shall not resolve into a matching +// mechanism + +module NegSem_B010303_permutation_005 { + + type record of integer RoI; + + template RoI t_source := ?; + // The source template resolves to a matching mechanism. It should cause an error. + template RoI t_perm1 := { permutation ( all from t_source, 2 ) }; + + + type component GeneralComp { + } + + testcase TC_NegSem_B010303_permutation_005() runs on GeneralComp { + if (match({ 2, 3 }, t_perm1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_B010303_permutation_005()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c8b2c527e487464a84f3f704ad7907c7f5c48d9 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/NegSem_B010303_permutation_006.ttcn @@ -0,0 +1,39 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Verify restriction on individual members of all from operand in permutation + ** @verdict pass reject + ***************************************************/ + +// The following requirement is tested: +// Individual members of a permutation and elements of the template in the all from +// clause shall only be expressions, templates, and the AnyElement and +// AnyElementsOrNone matching mechanisms. + +module NegSem_B010303_permutation_006 { + + type record of integer RoI; + + template RoI t_source := { 1, permutation(2, 3) } + // The source template contains a matching mechanism inside value (permutation) + // that is not mentioned as a valid content of the all from operand in + // B.1.3.3. restriction c + template RoI t_perm1 := { permutation ( all from t_source, * ) }; + + + type component GeneralComp { + } + + testcase TC_NegSem_B010303_permutation_006() runs on GeneralComp { + if (match({ 1, 4, 2, 3 }, t_perm1)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_NegSem_B010303_permutation_006()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0f0620c13301d9daf7b4892a0005d8a4b3b287a2 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_001.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_001 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), 5 }, + field2 := { permutation ( 1, 2, ? ), 5 }, + field3 := { permutation ( 1, 2, 3 ), * }, + field4 := { permutation ( (1,2,3), 2, 3 ), 5 } + } + + v_testMessage:= { + field1 := {2,1,3,5}, + field2 := {2,1,8,5}, + field3 := {3,2,1,8,8}, + field4 := {3,2,2,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a33a56a1540b7fd65d80ac9a2d8fc686ea75e8b --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_002.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_002 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), 5 }, //3 is missing from the match + field2 := { permutation ( 1, 2, ? ), 5 }, + field3 := { permutation ( 1, 2, 3 ), * }, + field4 := { permutation ( (1,2,3), 2, 3 ), 5 } + } + + v_testMessage:= { + field1 := {2,1,2,5}, + field2 := {2,1,8,5}, + field3 := {3,2,1,8}, + field4 := {3,2,2,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20a6fd05670e70a3da4b153c4293f5ec412257d8 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_003.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_003 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), 5 }, + field2 := { permutation ( 1, 2, ? ), 5 }, //there is an extra element in the sequence + field3 := { permutation ( 1, 2, 3 ), * }, + field4 := { permutation ( (1,2,3), 2, 3 ), 5 } + } + + v_testMessage:= { + field1 := {2,1,3,5}, + field2 := {2,1,8,8,5}, + field3 := {3,2,1,8}, + field4 := {3,2,2,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c981deeedac55f11abbf97348c7de22dcc29219 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_004.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_004 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), 5 }, + field2 := { permutation ( 1, 2, ? ), 5 }, + field3 := { permutation ( 1, 2, 3 ), * }, //wrong order of elements + field4 := { permutation ( (1,2,3), 2, 3 ), 5 } + } + + v_testMessage:= { + field1 := {2,1,3,5}, + field2 := {2,1,8,5}, + field3 := {3,2,8,1}, + field4 := {3,2,2,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6671a0b0326ef605969e5814277072b30326cbdb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_005.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles template matching of ? symbols in value elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_005 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), 5 }, + field2 := { permutation ( 1, 2, ? ), 5 }, + field3 := { permutation ( 1, 2, 3 ), * }, + field4 := { permutation ( (1,2,3), 2, 3 ), 5 } //wrong set of elements + } + + v_testMessage:= { + field1 := {2,1,3,5}, + field2 := {2,1,8,5}, + field3 := {3,2,8,1}, + field4 := {3,1,1,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2930942dd8e3368e97eff6f80200cb13ebcf1624 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_006.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that the IUT correctly handles permutation within arrays + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010303_permutation_006 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010303_permutation_006() runs on GeneralComp { + + var MessageType v_testMessage; + var template integer mw_field1 [4] := { permutation ( 1, 2, 3 ), 5 }; + var template integer mw_field2 [4] := { permutation ( 1, 2, ? ), 5 }; + var template integer mw_field3 [4] := { permutation ( 1, 2, 3 ), * }; + var template integer mw_field4 [4] := { permutation ( (1,2,3), 2, 3 ), 5 }; + + template MessageType mw_matchingTemplate:= + { + mw_field1, + mw_field2, + mw_field3, + mw_field4 + } + + v_testMessage:= { + field1 := {2,1,3,5}, + field2 := {2,1,8,5}, + field3 := {3,2,1,8}, + field4 := {3,2,2,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010303_permutation_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..84b54519aa5e84c6a2863a280d948712ccae4b51 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_007.ttcn @@ -0,0 +1,36 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that all from clause can be used inside permutation + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Besides specifying all individual values, it is possible to add all elements of +// a record of template into permutations using an all from clause. + +module Sem_B010303_permutation_007 { + + type record of integer RoI; + + template RoI t_source := { 1, 2 }; + template RoI t_perm1 := { permutation (all from t_source), 5 }; + template RoI t_perm2 := { -1, permutation (0, all from t_source, 3) }; + + + type component GeneralComp { + } + + testcase TC_Sem_B010303_permutation_007() runs on GeneralComp { + if (match({ 2, 1, 5 }, t_perm1) and match({ -1, 1, 0, 2, 3 }, t_perm2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_B010303_permutation_007()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..26cd5f2ee2f741ccf817b16a5ccbebfa0812e759 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_008.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 470 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that all from clause operand can be a set of value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// Besides specifying all individual values, it is possible to add all elements of +// a set of template into permutations using an all from clause. +// + +module Sem_B010303_permutation_008 { + + type set of integer SoI; + type record of integer RoI; + + template SoI t_source := { 1, 2 }; + template RoI t_perm1 := { permutation (all from t_source), 5 }; + template RoI t_perm2 := { -1, permutation (0, all from t_source, 3) }; + + + type component GeneralComp { + } + + testcase TC_Sem_B010303_permutation_008() runs on GeneralComp { + if (match({ 2, 1, 5 }, t_perm1) and match({ -1, 1, 0, 2, 3 }, t_perm2)) { + setverdict(pass); + } else { + setverdict(fail); + } + } + + control{ + execute(TC_Sem_B010303_permutation_008()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_009.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..78f3b67580a4fc7a569bcbfc5b6845e6c270e01f --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010303_permutation/Sem_B010303_permutation_009.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.3.3, Ensure that all from clause operand can be a set of value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +/* Restriction d) Individual members of a permutation and elements of the template in the all from clause shall only be +expressions, templates obeying to restriction c) above, and the AnyElement and AnyElementsOrNone matching +mechanisms.*/ + +module Sem_B010303_permutation_009 { + + type set of integer SoI; + type record of integer RoI; + + type record MessageType { + record of integer field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + + template SoI t_source := { 1, 2 ,?}; + template RoI t_perm1 := { permutation (all from t_source), 5 }; //using all from with ? + + testcase TC_Sem_B010303_permutation_009() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := t_perm1 + } + + v_testMessage:= { + field1 := {2,1,3,5} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + control{ + execute(TC_Sem_B010303_permutation_009()); + } + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a36f1c27cdb55bc35fb98e7c7667b41596c0208 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_003.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010401_length_restrictions_003 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4, + record of integer field5, + record of integer field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010401_length_restrictions_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), * } length (4), // message length is too short + field2 := { (1,2),* } length (2 .. 5), + field3 := { permutation ( 1, 2, 3 ), ? } length (4), + field4 := { (1,2),? } length (2 .. 5) + } + + v_testMessage:= { + field1 := {2,1,3}, + field2 := {2,1,3,5}, + field3 := {2,1,3,5}, + field4 := {1,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_NegSem_B010401_length_restrictions_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..422a78db17782dd1e4bb51900232bf1be436547d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/NegSem_B010401_length_restrictions_004.ttcn @@ -0,0 +1,64 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010401_length_restrictions_004 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4, + record of integer field5, + record of integer field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010401_length_restrictions_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), * } length (3..4), + field2 := { (1,2),* } length (2 .. 5), + field3 := { permutation ( 1, 2, 3 ), ? } length (2..3), // message length is too long + field4 := { (1,2),? } length (2 .. 5) + } + + v_testMessage:= { + field1 := {2,1,3}, + field2 := {2,1,3,5}, + field3 := {2,1,3,5}, + field4 := {1,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_NegSem_B010401_length_restrictions_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19c2c1e18e59fd770150d14db81d5c3bdb4d19e6 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_001.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010401_length_restrictions_001 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3, + charstring field4, + bitstring field5, + hexstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010401_length_restrictions_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test s*g" length (6 .. 13), + field2 := '10*'B length (3 .. 5), + field3 := '89*ABC'H length (5), + field4 := pattern "tes?" length (4 .. 13), + field5 := '10?'B length (3 .. 5), + field6 := '89?ABC'H length (6) + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H, + field4 := "test", + field5 := '101'B, + field6 := '899ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010401_length_restrictions_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dffa2c5abab2587d7a3d5ef4aadcd382649de6b4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_002.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010401_length_restrictions_002 { + + + type record MessageType { + record of integer field1, + record of integer field2, + record of integer field3, + record of integer field4 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010401_length_restrictions_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := { permutation ( 1, 2, 3 ), * } length (3 .. 4), + field2 := { (1,2),* } length (2 .. 5), + field3 := { permutation ( 1, 2, 3 ), ? } length (4), + field4 := { (1,2),? } length (2 .. 5) + } + + v_testMessage:= { + field1 := {2,1,3}, + field2 := {2,1,3,5}, + field3 := {2,1,3,5}, + field4 := {1,1} + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010401_length_restrictions_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9104dde025d141d4d7653778dabb88b7efd2a4d9 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_003.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010401_length_restrictions_003 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3, + charstring field4, + bitstring field5, + hexstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010401_length_restrictions_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test mess*ge" length (6 .. 8), //pattern is longer than length restriction - valid, but never matches + field2 := '10*'B length (3 .. 5), + field3 := '89*ABC'H length (5), + field4 := pattern "tes?" length (4 .. 13), + field5 := '10?'B length (3 .. 5), + field6 := '89?ABC'H length (6) + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H, + field4 := "test", + field5 := '101'B, + field6 := '899ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010401_length_restrictions_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b3528fade46e4493acbd36fbe5044e72cce0f936 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010401_length_restrictions/Sem_B010401_length_restrictions_004.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 1:B.1.4.1, Ensure that the IUT correctly handles template matching of value length definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010401_length_restrictions_004 { + + + type record MessageType { + charstring field1, + bitstring field2, + hexstring field3, + charstring field4, + bitstring field5, + hexstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010401_length_restrictions_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test s*g" length (6 .. 15), + field2 := '10*'B length (3 .. 5), + field3 := '89?AB'H length (6), //pattern is shorter than length restriction + field4 := pattern "tes?" length (4 .. 13), + field5 := '10?'B length (3 .. 5), + field6 := '89?ABC'H length (6) + } + + v_testMessage:= { + field1 := "test string", + field2 := '10101'B, + field3 := '89ABC'H, + field4 := "test", + field5 := '101'B, + field6 := '899ABC'H + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010401_length_restrictions_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/NegSem_B010402_ifPresent_indicator_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/NegSem_B010402_ifPresent_indicator_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4258cce52c8e7872dcfbbc063b81b6efa64a715e --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/NegSem_B010402_ifPresent_indicator_001.ttcn @@ -0,0 +1,66 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.2, Ensure that the IUT correctly handles template matching of ifpresent indicators + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010402_ifPresent_indicator_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1 optional, + charstring field2 optional, + RecordType field3, + UnionType field4 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_NegSem_B010402_ifPresent_indicator_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2) ifpresent, + field2 := ("aaa".."fff") ifpresent, + field3 := {a:=1,b:=(0..2) ifpresent,c:=true} ifpresent, //use of ifpresent on non-optional field + field4 := {a:=(0..2)} ifpresent + } + + v_testMessage:= { + field1 := omit, + field2 := omit, + field3 := {a:=1,b:=omit,c:=true}, + field4 := omit + } + + messagePort.send(v_testMessage); +} + +control{ + execute(TC_NegSem_B010402_ifPresent_indicator_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53d8830eadba3de1e8055d61b6cc00343c4d51f7 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_001.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.2, Ensure that the IUT correctly handles template matching of ifpresent indicators + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010402_ifPresent_indicator_001 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1 optional, + charstring field2 optional, + RecordType field3, + UnionType field4 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010402_ifPresent_indicator_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2) ifpresent, + field2 := "[a-f]" ifpresent, + field3 := {a:=1,b:=(0..2) ifpresent,c:=true}, + field4 := {a:=(0..2)} ifpresent + } + + v_testMessage:= { + field1 := omit, + field2 := omit, + field3 := {a:=1,b:=omit,c:=true}, + field4 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010402_ifPresent_indicator_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68cef213c63a605f6b826a51ed1849e51863d343 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0104_matching_attributes_of_values/B010402_ifPresent_indicator/Sem_B010402_ifPresent_indicator_002.ttcn @@ -0,0 +1,75 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.4.2, Ensure that the IUT correctly handles template matching of ifpresent indicators + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010402_ifPresent_indicator_002 { + + type enumerated EnumeratedType {e_black, e_white, e_green}; + + type record RecordType { + integer a optional, + integer b optional, + boolean c + } + + type union UnionType { + integer a, + EnumeratedType b, + boolean c + } + + type record MessageType { + integer field1 optional, + charstring field2 optional, + RecordType field3, + UnionType field4 optional + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010402_ifPresent_indicator_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := (0..2) ifpresent, + field2 := ("a".."f") length (3) ifpresent, + field3 := {a:=1,b:=(0..2) ifpresent,c:=true}, //element b is present and out of range + field4 := {a:=(0..2)} ifpresent + } + + v_testMessage:= { + field1 := omit, + field2 := omit, + field3 := {a:=1,b:=3,c:=true}, + field4 := omit + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010402_ifPresent_indicator_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f695d918f7acc1b4aa3273ac34305a62c25479ed --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_001.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_001 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[pqrs]t[0-9]", + field2 := pattern "test[^a-z]", + field3 := pattern "[A-Z]est" + } + + v_testMessage:= { + field1 := "test1", + field2 := "test1", + field3 := "Test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a460abfe451dde35a8c2a3ca510d0377f2a2546 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_002.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_002 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[pqrs]t[0-9]", //mismatching set + field2 := pattern "test[^a-z]", + field3 := pattern "[A-Z]est" + } + + v_testMessage:= { + field1 := "text1", + field2 := "test1", + field3 := "Test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86d077d246b5fafe8b786eafcaccf012e87b3d92 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_003.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_003 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[pqrs]t[0-9]", + field2 := pattern "test[^a-z]", //mismatching negation + field3 := pattern "[A-Z]est" + } + + v_testMessage:= { + field1 := "test1", + field2 := "testx", + field3 := "Test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d17c74b32e240aba17d06e8a90af2279b841991c --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_004.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_004 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[pqrs]t[0-9]", + field2 := pattern "test[^a-z]", + field3 := pattern "[A-Z]est" //mismatching small/large caps + } + + v_testMessage:= { + field1 := "test1", + field2 := "test1", + field3 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..602931f1c729ff5d13483d1af68cef08ecd9bedc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_005.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_005 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[pqrs]t[0-9]", + field2 := pattern "test[^a-z]", + field3 := pattern "test[-]string" //mismatching literal - separator + } + + v_testMessage:= { + field1 := "test1", + field2 := "test1", + field3 := "test string" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4d84ac404dd01e25259220f726c8444f92d4de26 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010501_set_expression/Sem_B010501_set_expression_006.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.1, Ensure that the IUT correctly handles template matching of character pattern set expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010501_set_expression_006 { + + + type record MessageType { + universal charstring field1, + universal charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010501_set_expression_006() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "test[\q{0,0,1,113}]", //accepted \q character is ű + field2 := pattern "test[^\q{0,0,1,113}]" //accepted characters are: anything execpt ű + } + + v_testMessage:= { + field1 := "testű", + field2 := "testb" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010501_set_expression_006()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18c82c00afc6571af87cb84af4da455660e43aca --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_001.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_001 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort; +} + +testcase TC_Sem_B010502_reference_expression_001(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_001("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e0e67115a8bb56a6e8e740526b6763f7c8d39c21 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_002.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_002 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_002(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", //mismatch in this reference + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference ", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_002("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8cde0e0ecacb068cb6e119222466462c01c5990d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_003.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_003 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_003(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", //mismatch in this reference + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference ", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_003("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5072009fcd3c2cf928a7d35999715ee561ef334a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_004.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_004 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_004(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", //mismatch in this reference + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference ", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_004("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d747165f9d8e6d7008d4c1eb4219da3ea0c75c72 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_005.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_005 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_005(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + template charstring m_RefExp_p1 := pattern "{m_"; + template charstring m_RefExp_p2 := pattern "Ref}!"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", //mismatch in this reference + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference ", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_005("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f9866b5d85559434a28733eb05d06b4abd31a03 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_006.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_006 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_006(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", //mismatch in this reference + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference ", + field6 := "constant reference!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_006("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5da71fae212053591ab7b6eb93305386db0b2120 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_007.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_007 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_007(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", //mismatch in this reference + field7 := pattern "{v_Ref} and {c_Ref}" + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "{m_Ref}!", + field7 := "variable reference and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_007("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_008.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2f4a1b894815b0be4084e17257dab21e8bf6706a --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_008.ttcn @@ -0,0 +1,77 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_008 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_008(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{v_Ref} and {c_Ref}" //mismatch in this reference + }; + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := " and constant reference" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_008("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_009.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1beca273a0854905c5867cc03b6fd9ccae644d49 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_009.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_009 { + + + type record MessageType { + charstring field1 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_009() runs on GeneralComp { + + var MessageType v_testMessage; + template charstring m_Ref:="a-z"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[{m_Ref}]" //mismatch as {} looses its meaning inside [] + }; + + v_testMessage:= { + field1 := "x" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_009()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_010.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6ce7bd460b8c23bb5d8322f367be216705ebc03 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_010.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_010 { + + + type record MessageType { + universal charstring field1, + universal charstring field2, + universal charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_010() runs on GeneralComp { + + var MessageType v_testMessage; + const charstring m_Ref:="abc?def?"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{\m_Ref}", // this should accept pattern "abc?def?" only + field2 := pattern "{m_Ref}\q{0,0,1,113}", // this should accept pattern "abc?def?" only, with any character in ? + field3 := pattern "{\m_Ref}\q{0,0,1,113}" // this should accept pattern "abc?def?ű" only + + }; + v_testMessage:= { + field1 := "abc?def?", + field2 := "abcDdefGű", + field3 := "abc?def?ű" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass,v_testMessage); + } + [] messagePort.receive { + setverdict(fail,"Unexpected decoding result:",v_testMessage); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_010()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_011.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c801ba829d83b56e4575bc82a89389959e54a32 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010502_reference_expression/Sem_B010502_reference_expression_011.ttcn @@ -0,0 +1,60 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010502_reference_expression_011 { + + + type record MessageType { + universal charstring field1, + universal charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010502_reference_expression_011() runs on GeneralComp { + + var MessageType v_testMessage; + const MessageType m_Ref:={"1","ABCabc"}; + const charstring referencedConstant_1 := m_Ref.field1; + const charstring referencedConstant_2 := m_Ref.field2; + + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{referencedConstant_1}", + field2 := pattern "{referencedConstant_2}" + }; + + v_testMessage:= { + field1 := "1", + field2 := "ABCabc" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass,v_testMessage); + } + [] messagePort.receive { + setverdict(fail,"Unexpected decoding result:",v_testMessage); + } + } +} + +control{ + execute(TC_Sem_B010502_reference_expression_011()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9700b2c64d50b753f1e13adcf7c88ce4765c2a65 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_001.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010503_match_n_times_001 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010503_match_n_times_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[e-t]#4", + field2 := pattern "[e-t]+", + field3 := pattern "[e-t]#(3,5)", + field4 := pattern "[e-t]#(3,)", + field5 := pattern "[e-t]#(,5)" + } + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010503_match_n_times_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..550baf63715fd201d97c137d019dda5638945c74 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_002.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010503_match_n_times_002 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010503_match_n_times_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[e-t]#5", //mismatching number of characters + field2 := pattern "[e-t]+", + field3 := pattern "[e-t]#(3,5)", + field4 := pattern "[e-t]#(3,)", + field5 := pattern "[e-t]#(,5)" + } + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010503_match_n_times_002()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2bb58678174eab47633497c46b194fcd3748d6bc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_003.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010503_match_n_times_003 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010503_match_n_times_003() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[e-t]#4", + field2 := pattern "test[e-t]+", //mismatching number of characters + field3 := pattern "[e-t]#(3,5)", + field4 := pattern "[e-t]#(3,)", + field5 := pattern "[e-t]#(,5)" + } + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010503_match_n_times_003()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..155c1b37efc6d7d9d0b8d66675645078c86181b6 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_004.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010503_match_n_times_004 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010503_match_n_times_004() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[e-t]#4", + field2 := pattern "test[e-t]+", + field3 := pattern "[e-t]#(3,5)", + field4 := pattern "[e-t]#(5,)", //mismatching number of characters + field5 := pattern "[e-t]#(,5)" + } + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010503_match_n_times_004()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3e0bb87d307830534ea1c1f529578433b503591 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010503_match_n_times/Sem_B010503_match_n_times_005.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010503_match_n_times_005 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010503_match_n_times_005() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "[e-t]#4", + field2 := pattern "test[e-t]+", + field3 := pattern "[e-t]#(3,5)", + field4 := pattern "[e-t]#(3,)", + field5 := pattern "[e-t]#(,3)" //mismatching number of characters + } + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010503_match_n_times_005()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/NegSem_B010504_match_referenced_characters_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/NegSem_B010504_match_referenced_characters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99a694326fd3f4ca7c382c482b66cc58737a7970 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/NegSem_B010504_match_referenced_characters_001.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass reject + ***************************************************/ + +module NegSem_B010504_match_referenced_characters_001 { + + modulepar { + charstring MOD_REF:="ef"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort; + const charstring c_Ref:="s"; +} + +testcase TC_NegSem_B010504_match_referenced_characters_001(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", //reference length is more than one character + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te[\N{m_Ref}]t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + +} + +control{ + execute(TC_NegSem_B010504_match_referenced_characters_001("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..674bbd4ed2bc7b38e7a7fcdd5328ff76272cf4d9 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_001.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_001 { + + modulepar { + charstring MOD_REF:="e"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_001(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_001("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..888108686ebec32b529804b3f8cd7139ba4f6629 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_002.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_002 { + + modulepar { + charstring MOD_REF:="e"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_002(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="x"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", //reference character mismatch + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_002("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_003.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f67fcf54518c6f12163e421a48209bf303a58069 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_003.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_003 { + + modulepar { + charstring MOD_REF:="e"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="x"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_003(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", //reference character mismatch + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_003("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_004.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1d25c3845c28da18efd62cdce377ba192b73646 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_004.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_004 { + + modulepar { + charstring MOD_REF:="s"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_004(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", //reference character mismatch + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_004("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_005.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a2c811fb11018819d355776a2913e7d76cecfbf --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_005.ttcn @@ -0,0 +1,74 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_005 { + + modulepar charstring MOD_REF:="e"; + + type charstring CharRange ("s".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_005(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" //reference character mismatch + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_005("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_006.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8015ca9f9a139d5246bbb55c388eef20d08ddda4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_006.ttcn @@ -0,0 +1,74 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_006 { + + modulepar charstring MOD_REF:="e"; + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_006(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="s"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", //reference character mismatch + field5 := pattern "te\N{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "test", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(fail); + } + [] messagePort.receive { + setverdict(pass); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_006("x")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_007.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5302bcb89ec6bb20071a51ff05b4ec62f6e8955 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010504_match_referenced_characters/Sem_B010504_match_referenced_characters_007.ttcn @@ -0,0 +1,76 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.4, Ensure that the IUT correctly handles template matching of character pattern reference characters + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010504_match_referenced_characters_007 { + + modulepar { + charstring MOD_REF:="e"; + } + + type charstring CharRange ("e".."t"); + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="s"; + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010504_match_referenced_characters_007(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="s"; + template charstring m_Ref:="{c_Ref}"; //assuming dereferencing is only done once, no chained references + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te[\N{v_Ref}]t", + field2 := pattern "[\N{c_Ref}et]+", + field3 := pattern "[\N{MOD_REF}-t]+", + field4 := pattern "te[\N{p_Ref}]t", + field5 := pattern "te{m_Ref}t", + field6 := pattern "\N{CharRange}+" + }; + + v_testMessage:= { + field1 := "test", + field2 := "test", + field3 := "test", + field4 := "test", + field5 := "te{c_Ref}t", + field6 := "test" + }; + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010504_match_referenced_characters_007("s")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/NegSyn_B010505_pattern_compatibility_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/NegSyn_B010505_pattern_compatibility_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..045847ef7e69f350fbce633da0fdda65fd401ed4 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/NegSyn_B010505_pattern_compatibility_001.ttcn @@ -0,0 +1,23 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.0, Ensure that the IUT correctly handles character pattern metacharacters + compatibility rules of template matching + ** @verdict pass reject + ***************************************************/ + +module NegSyn_B010505_pattern_compatibility_001 { + + type component GeneralComp {} + +testcase TC_NegSyn_B010505_pattern_compatibility_001() runs on GeneralComp { + + template charstring mw_matchingTemplate:= pattern "??riable reference"; + var charstring mw_matchingTemplate_2:= pattern mw_matchingTemplate; // error: Cannot assign a template to a non-template variable. + +} +control{ + execute(TC_NegSyn_B010505_pattern_compatibility_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3ed3b50dfa22d4433d922284339621020e0e8dbb --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.5, Ensure that the IUT correctly handles character pattern compatibility rules of template matching + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010505_pattern_compatibility_001 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + universal charstring field1, + universal charstring field2, + universal charstring field3, + universal charstring field4, + universal charstring field5, + universal charstring field6, + universal charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010505_pattern_compatibility_001(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + template charstring m_RefExp_p1 := "{m_"; + template charstring m_RefExp_p2 := "Ref}!"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{m_RefExp_p1}{m_RefExp_p2}" + } + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "{m_Ref}!" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010505_pattern_compatibility_001("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..551384077a1c32ba443d69ca1f2bdeb73a0527ca --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010505_pattern_compatibility/Sem_B010505_pattern_compatibility_002.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5.5, Ensure that the IUT correctly handles character pattern compatibility rules of template matching + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B010505_pattern_compatibility_002 { + + modulepar { + universal charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5, + charstring field6, + charstring field7 + } + + type port loopbackPort message { + inout MessageType + } + + const universal charstring c_Ref:="constant reference"; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010505_pattern_compatibility_002(universal charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var universal charstring v_Ref:="variable reference"; + template universal charstring m_Ref:= pattern "{c_Ref}"; + template universal charstring m_RefExp_p1 := pattern "{m_"; + template universal charstring m_RefExp_p2 := pattern "Ref}!"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "{v_Ref}", + field2 := pattern "{c_Ref}", + field3 := pattern "{MOD_REF}", + field4 := pattern "{p_Ref}", + field5 := pattern "{m_Ref}", + field6 := pattern "{m_"&"Ref}!", + field7 := pattern "{m_RefExp_p1}{m_RefExp_p2}" + } + + v_testMessage:= { + field1 := "variable reference", + field2 := "constant reference", + field3 := "modulepar reference", + field4 := "parameter reference", + field5 := "constant reference", + field6 := "constant reference!", + field7 := "{m_Ref}!" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B010505_pattern_compatibility_002("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3d97d20def9bc46d3a71282521dbb28c2ce277dc --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_001.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.6, Ensure that the IUT correctly handles character pattern compatibility rules of template case sensitive matching (@nocase) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: +When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way +*/ + +module Sem_B010506_case_sensitive_pattern_matching_001 { + + modulepar { + charstring MOD_REF:="modulepar reference"; + } + + type record MessageType { + universal charstring field1, + universal charstring field2, + universal charstring field3, + universal charstring field4, + universal charstring field5, + universal charstring field6, + universal charstring field7, + universal charstring field8 + } + + type port loopbackPort message { + inout MessageType + } + + const charstring c_Ref:="constant reference"; + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B010506_case_sensitive_pattern_matching_001(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + var charstring v_Ref:="variable reference"; + template charstring m_Ref:= pattern "{c_Ref}"; + template charstring m_RefExp_p1 := "{m_"; + template charstring m_RefExp_p2 := "Ref}!"; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern @nocase "{v_Ref}", + field2 := pattern @nocase"{c_Ref}", + field3 := pattern @nocase"{MOD_REF}", + field4 := pattern @nocase"{p_Ref}", + field5 := pattern @nocase"{m_Ref}", + field6 := pattern @nocase"{m_"&"Ref}!", + field7 := pattern @nocase"{m_RefExp_p1}{m_RefExp_p2}", + field8 := pattern @nocase"var*?e" + } + + v_testMessage:= { + field1 := "VaRiAbLe ReFeReNcE", + field2 := "conSTant ReFeReNcE", + field3 := "modulepar ReFeReNcE", + field4 := "PARAMETER ReFeReNcE", + field5 := "CONStant ReFeReNcE", + field6 := "consTANT ReFeReNcE!", + field7 := "{m_ref}!", + field8 := "VaRiAbLe ReFeReNcE" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass,v_testMessage); + } + [] messagePort.receive { + setverdict(fail,v_testMessage); + } + } +} + +control{ + execute(TC_Sem_B010506_case_sensitive_pattern_matching_001("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ae811d2daf7e71f53d0187351d30dbb0ac46e76 --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B010506_case_sensitive_pattern_matching/Sem_B010506_case_sensitive_pattern_matching_002.ttcn @@ -0,0 +1,62 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5.6, Ensure that the IUT correctly handles character pattern compatibility rules of template case sensitive matching (@nocase) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: +When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way +*/ + +module Sem_B010506_case_sensitive_pattern_matching_002 { + + + type record MessageType { + universal charstring field1, + universal charstring field2 + } + + type port loopbackPort message { + inout MessageType + } + +type component GeneralComp { + port loopbackPort messagePort +} + const universal charstring MyCons :="A"; + +testcase TC_Sem_B010506_case_sensitive_pattern_matching_002(charstring p_Ref) runs on GeneralComp { + + var MessageType v_testMessage; + template charstring m_Ref:= pattern "abc"; + + + template MessageType mw_matchingTemplate:= + { + field1 := pattern @nocase "{m_Ref} \q{0,0,1,113}", // expected value: abc ű + field2 := pattern @nocase "\N{MyCons}" // expected value: A + } + + v_testMessage:= { + field1 := "aBc Ű", // with @nocase - this is also valid + field2 := "a" // with @nocase - this is also valid + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass,v_testMessage); + } + [] messagePort.receive { + setverdict(fail,v_testMessage); + } + } +} + +control{ + execute(TC_Sem_B010506_case_sensitive_pattern_matching_002("parameter reference")); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_001.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3cbd9efe276cf0e1fcea0b481a799ac1def8d87d --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_001.ttcn @@ -0,0 +1,65 @@ +/*************************************************** + ** @author STF 409 + ** @version 0.0.1 + ** @purpose 1:B.1.5, Ensure that the IUT correctly handles template matching of character pattern definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0105_toplevel_001 { + + + type record MessageType { + charstring field1, + charstring field2, + charstring field3, + charstring field4, + charstring field5 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0105_toplevel_001() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "te?t\?", + field2 := pattern "test|string", + field3 := pattern "test" & " " & "string", + field4 := pattern "tes\w\b\s\d", + field5 := pattern "\[\\\]" + } + + v_testMessage:= { + field1 := "test?", + field2 := "string", + field3 := "test string", + field4 := "test 1", + field5 := "[\]" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass); + } + [] messagePort.receive { + setverdict(fail); + } + } +} + +control{ + execute(TC_Sem_B0105_toplevel_001()); +} + +} diff --git a/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_002.ttcn b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40df24f06f88756b56a406d92c069b6aee8a089c --- /dev/null +++ b/ATS/core_language/B_matching_incoming_values/B01_template_matching/B0105_matching_character_pattern/B0105_toplevel/Sem_B0105_toplevel_002.ttcn @@ -0,0 +1,59 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:B.1.5, Ensure that the IUT correctly handles template quadruple and USI-like syntax matching of character pattern definitions + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +module Sem_B0105_toplevel_002 { + + + type record MessageType { + universal charstring field1, + universal charstring field2, + universal charstring field3 + } + + type port loopbackPort message { + inout MessageType + } + + +type component GeneralComp { + port loopbackPort messagePort +} + +testcase TC_Sem_B0105_toplevel_002() runs on GeneralComp { + + var MessageType v_testMessage; + + template MessageType mw_matchingTemplate:= + { + field1 := pattern "\q{0,0,1,113}", //"quadruple" notation for character "ű" + field2 := pattern "\q{0,0,1,113}*\q{0,0,1,116}", //"quadruple" notation for character "ű" and "Ŵ" + field3 := pattern "\q{U0171}" // USI like notation for character "ű" + } + + v_testMessage:= { + field1 := "ű", + field2 := "ű1234Ŵ", + field3 := "ű" + } + + messagePort.send(v_testMessage); + + alt { + [] messagePort.receive(mw_matchingTemplate) { + setverdict(pass,v_testMessage); + } + [] messagePort.receive { + setverdict(fail,"Unexpected decoding result:",v_testMessage); + } + } +} + +control{ + execute(TC_Sem_B0105_toplevel_002()); +} + +} diff --git a/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_hostid_function_001.ttcn b/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_hostid_function_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fbbf6acde72afc9e1598d5dd3704c3642edb7fc --- /dev/null +++ b/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_hostid_function_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 1:C.6.2, Ensure that the IUT correctly handles the hostid function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +/* The following requirements are tested: + * check that hostid function correctly evaluates the IPv4 or IPv6 address of the host. + * The output of this test must be manually validated. Todo for future STF: automated validation via external function. + * */ + +module Sem_C0602_The_hostid_function_001 { + + type component GeneralComp {} + type charstring IPaddressV4 (pattern "[0-9,.]#(7,15)"); // size of charstring is limited to 7-15 and contains numbers from 1-9 and "." + type charstring IPaddressV6 (pattern @nocase "[0-9,a-f,:]#(1,37)"); // contains numbers from 1-9, a-f and ":". The size of chastring is limited to 37 + + testcase TC_Sem_C0602_The_hostid_function_001() runs on GeneralComp { + + var IPaddressV4 v_ipv4hostid; + var IPaddressV6 v_ipv6hostid; + + if ((lengthof(hostid("IPv4")) == 0) or (lengthof(hostid("IPv6"))==0 )) // in case of no ip address is given + { + setverdict(pass, "No ip address on interface"); + } + + else{ + + v_ipv4hostid := hostid("IPv4"); // check IPv4 address with subtyping + setverdict(pass, v_ipv4hostid); + + v_ipv6hostid := hostid("IPv6"); // check IPv6 address with subtyping + setverdict(pass, v_ipv6hostid); + } + + + } + control{ + // execute(TC_Sem_C0602_The_hostid_function_001(), -, "127.0.0.1"); //not supported by TestCast + execute(TC_Sem_C0602_The_hostid_function_001()); + + } + +} \ No newline at end of file diff --git a/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_testcasename_function_001.ttcn b/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_testcasename_function_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a39ef17e545251e56a8d3a51a955a24faf692dcd --- /dev/null +++ b/ATS/core_language/C_predefined_functions/C06_Other_functions/C0602_The_testcasename_function/Sem_C0602_The_testcasename_function_001.ttcn @@ -0,0 +1,29 @@ +/*************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:C.6.2, Ensure that the IUT correctly handles the testcasename function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Sem_C0602_The_testcasename_function_001 { + + type component GeneralComp { + } + + // add a second testcase in order to see that the right TC name is returned + testcase TC_Sem_C0602_The_testcasename_function_001_other() runs on GeneralComp { + } + + testcase TC_Sem_C0602_The_testcasename_function_001() runs on GeneralComp { + var charstring v_TCname := testcasename(); + if (match(v_TCname, "TC_Sem_C0602_The_testcasename_function_001")) { + setverdict(pass); + } else { + setverdict(fail, "Expected TC name TC_Sem_C0602_The_testcasename_function_001 observer " & v_TCname); + } + } + + control{ + execute(TC_Sem_C0602_The_testcasename_function_001()); + } + +} \ No newline at end of file diff --git a/ATS/core_language/C_predefined_functions/NOTES b/ATS/core_language/C_predefined_functions/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..b78174200c39420ac1991bce87fea4d988e9e22c --- /dev/null +++ b/ATS/core_language/C_predefined_functions/NOTES @@ -0,0 +1 @@ +- NOTE: The contents of Annex C are tested by the tests under section 16.1.2. \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D01_macro_module/Sem_D01_macro_module_001.ttcn b/ATS/core_language/D_preprocessing_macros/D01_macro_module/Sem_D01_macro_module_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a31959248b86c30c17be1a4db65b025ddf40dc6 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D01_macro_module/Sem_D01_macro_module_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __MODULE__ replaces the module name + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// The name of the module is stored in __MODULE__ macro +module Sem_D01_macro_module_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_D01_macro_module_001() runs on GeneralComp system GeneralComp { + + const charstring MyConst:= __MODULE__; + + if(match(MyConst, "Sem_D01_macro_module_001")){ + setverdict(pass);} + else { + setverdict(fail);} + } + + control { + execute(TC_Sem_D01_macro_module_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D02_macro_file/Sem_D02_macro_file_001.ttcn b/ATS/core_language/D_preprocessing_macros/D02_macro_file/Sem_D02_macro_file_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2756bb84af2c36690ebe8480cdbb7064f5e6faef --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D02_macro_file/Sem_D02_macro_file_001.ttcn @@ -0,0 +1,28 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __FILE__ macro stores the path and file name in a charstring + ** @verdict pass accept, noexecution + *****************************************************************/ + +module Sem_D02_macro_file_001 { + + type component GeneralComp { } + + testcase TC_Sem_D02_macro_file_001() runs on GeneralComp system GeneralComp { + + const charstring MyConst:= __FILE__; + // will match file paths of the form .../Sem_D02_macro_file_001.ttcn or ...\Sem_D02_macro_file_001.ttcn + template charstring namePattern := pattern "*[\\/]Sem_D02_macro_file_001.ttcn"; + + if(match(MyConst, namePattern)){ + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_D02_macro_file_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D03_macro_bfile/Sem_D03_macro_bfile_001.ttcn b/ATS/core_language/D_preprocessing_macros/D03_macro_bfile/Sem_D03_macro_bfile_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ae2db0b4bc60b2f4f1f187b9e2a3fa8e5495cc9 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D03_macro_bfile/Sem_D03_macro_bfile_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that the __BFILE__ macro replaces the actual file name + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// the actual file name is given in __BFILE__ macro. +module Sem_D03_macro_bfile_001 { + + type component GeneralComp {} + + testcase TC_Sem_D03_macro_bfile_001() runs on GeneralComp system GeneralComp { + + const charstring MyConst:=__BFILE__; + + if(match(MyConst, "Sem_D03_macro_bfile_001.ttcn")){ + setverdict(pass); + } else { + setverdict(fail); + } + } + + control { + execute(TC_Sem_D03_macro_bfile_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D04_macro_line/Sem_D04_macro_line_001.ttcn b/ATS/core_language/D_preprocessing_macros/D04_macro_line/Sem_D04_macro_line_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9af470c7b6790afb9c7bb0ca3040a77835ea6068 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D04_macro_line/Sem_D04_macro_line_001.ttcn @@ -0,0 +1,27 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __LINE__ macro stores the actual line number when it is called + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// In this case the line number when the macro is called at line 15. +module Sem_D04_macro_line_001 { + + type component GeneralComp {} + function f1 ( ) runs on GeneralComp {} + + testcase TC_Sem_D04_macro_line_001() runs on GeneralComp system GeneralComp { + + const integer MyConst:= __LINE__; // line 15 + + if (match(MyConst, 15)) { + setverdict(pass); + } else { + setverdict(fail, "Expected line 15, wrong line number"); + } + } + + control { + execute(TC_Sem_D04_macro_line_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D05_macro_scope/NegSem_D05_macro_scope_001.ttcn b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/NegSem_D05_macro_scope_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d0495a294cd471a46f7434847c3c6514a5841e13 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/NegSem_D05_macro_scope_001.ttcn @@ -0,0 +1,31 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __SCOPE__ replaces the actual higher named basic scope unit + ** @verdict pass reject + *****************************************************************/ +// __SCOPE__ replaces the actual higher basic unit + +module NegSem_D05_macro_scope_001 { + + type component GeneralComp { + var charstring variable1:=__SCOPE__; //variable1=="GeneralComp" + } + + type record MyRecord { + charstring variable0 ("1","2",__SCOPE__) // variable0=="MyRecord" + } + + testcase TC_NegSem_D05_macro_scope_001() runs on GeneralComp system GeneralComp { + + template MyRecord Mytemplate:={ + variable0:="__SCOPE__" //Causes an error as __SCOPE__ is replaced with Mytemplate + } + + + } + + control { + execute(TC_NegSem_D05_macro_scope_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_001.ttcn b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f10f4b8203adc2f0ebd918e29f303ea16bf2188 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_001.ttcn @@ -0,0 +1,26 @@ +/***************************************************************** + ** @author STF 451 (updated by STF 521) + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __SCOPE__ replaces the actual higher basic unit + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// __SCOPE__ replaces the actual higher basic unit (name of the test component) +module Sem_D05_macro_scope_001 { + type component GeneralComp { + const charstring MyConst := __SCOPE__; + } + + testcase TC_Sem_D05_macro_scope_001() + runs on GeneralComp system GeneralComp { + + + if (match(MyConst, "GeneralComp")) { + setverdict(pass); + } else { + setverdict(fail); + } + } + control { + execute(TC_Sem_D05_macro_scope_001()); + } +} \ No newline at end of file diff --git a/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_002.ttcn b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..87af2448d9ce244a292bf825000fb4e65c08f607 --- /dev/null +++ b/ATS/core_language/D_preprocessing_macros/D05_macro_scope/Sem_D05_macro_scope_002.ttcn @@ -0,0 +1,35 @@ +/***************************************************************** + ** @author STF 451 + ** @version 0.0.1 + ** @purpose 1:D, Ensure that __SCOPE__ replaces the actual higher basic unit + ** @verdict pass accept, ttcn3verdict:pass + *****************************************************************/ +// __SCOPE__ replaces the actual higher basic unit +module Sem_D05_macro_scope_002 { + + type component GeneralComp { + var charstring variable1:=__SCOPE__; //variable1=="GeneralComp" + } + + type record MyRecord { + charstring variable0 ("1","2",__SCOPE__) + } + + testcase TC_Sem_D05_macro_scope_002() runs on GeneralComp system GeneralComp { + + template MyRecord Mytemplate:={ + variable0:="MyRecord" //MyRecord is a legal element because of __SCOPE__ + } + + if(match(variable1, "GeneralComp")){ + setverdict(pass); + } else { + setverdict(fail); + } + + } + + control { + execute(TC_Sem_D05_macro_scope_002()); + } +} \ No newline at end of file diff --git a/ATS/core_language/NOTES b/ATS/core_language/NOTES new file mode 100644 index 0000000000000000000000000000000000000000..4298b54344324d004b52e1425579521a1cd906c7 --- /dev/null +++ b/ATS/core_language/NOTES @@ -0,0 +1,11 @@ +The @configuration port:XYZ directive in the header indicates the type of adapter being used. +The two possible port: values are broadcast/loopback. +For historical reasons, the absence of this directive means loopback adapter. +Example: + ** @configuration port:broadcast + +The following example indicates external functions used in the test case + ** @configuration external_functions + + +- TODO: check that each match operation is used correctly (must not be used to compare templates!!) \ No newline at end of file diff --git a/ATS/core_language/PROGRESS_FILE.txt b/ATS/core_language/PROGRESS_FILE.txt new file mode 100644 index 0000000000000000000000000000000000000000..032947e8a1354a7ba5aad3a5e14177e746c70312 --- /dev/null +++ b/ATS/core_language/PROGRESS_FILE.txt @@ -0,0 +1,105 @@ +This file is used for tracking progress of implementation of new test cases. +The exact description of required updates is in /trunk/standards/4.7.1/part-1-changes.txt + +3.1 Definitions (Tomas, implemented in 5.4) +5.4.1 Formal parameters (Tomas, done: 32 new tests, 29 positive, 3 negative) +5.4.1.1 Formal parameters of kind value (Tomas, done: 48 new tests, 18 positive, 30 negative) +5.4.1.2 Formal parameters of kind template (Tomas, done: 54 new tests, 34 positive, 18 negative) +5.4.2 Actual parameters (Tomas, done: 345 new tests, 200 positive, 145 negative; 14 CRs) +6.1.1 Basic string types and values (Andras, done: 1 new test, 1 positive) +6.1.2.5 Pattern subtyping (Andras, done: 3 new tests, 1 positive, 2 negative) +6.1.2.6.2 Using length restriction with other constraints (Andras, done: 1 new test, 1 positive) +6.2.1.1 Referencing fields of a record type (Tomas, done: 16 new tests, 13 positive, 3 negative) +6.2.3 Records and sets of single types (Tomas, done: 24 new tests, 16 positive, 8 negative) +6.2.4 Enumerated type and values (Tomas, done: 21 new tests, 8 positive, 13 negative; 1 CR) +6.2.5 Unions (Tomas, done: 9 new tests, 3 positive, 6 negative) +6.2.5.1 Referencing fields of a union type (Tomas, done: 13 new tests, 5 positive, 8 negative) +6.2.5.1 Option and union (Tomas, done: 1 new test, 0 positive, 1 negative) +6.2.5.1 Nested type definition for field types (Tomas, done: 1 new test, 1 positive, 0 negative) +6.2.7 Arrays (Tomas, done: 36 new tests, 17 positive, 19 negative; 3 CR) +6.2.9 Communication port type (Andras, done: 1 new test, 1 positive) +6.2.10.2 Reuse of component types (Andras, done: 6 new tests, 3 positive, 3 negative) +6.2.12 Addressing entities inside the SUT (Andras, done: 3 new tests, 3 negative) +6.3.4 Type compatibility of communication and connection operations (Tomas, done: 5 new tests, 0 positive, 5 negative; 2 CR) +7 Expressions (Tomas, done: 11 new tests, 6 positive, 5 negative; 2 CR) +7.1.1 Arithmetic operators (Andras, WIP) +7.1.3 Relational operators (Andras, WIP) +8.1 Definition of a module (Andras, WIP) +8.2.3.1 General format of import (Andras, WIP) +8.2.3.8 Compatibility of language specifications in imports (Andras, WIP) +9.1 Communication ports (Andras, done: 11 new tests, 3 positive, 8 negative) +10 Declaring constants (Andras, done: 2 new tests, 2 negative) +11.1 Value variables (Andras, done: 2 new tests, 2 negative) +11.2 Template variables (Andras, done: 2 new tests, 2 negative) +15.5 Modified templates (Andras, WIP) +15.6 Referencing elements of templates or template fields (Andras, WIP) +15.6.2 Referencing record and set fields (Andras, WIP) +15.6.3 Referencing record of and set of elements (Andras, WIP) +15.6.5 Referencing union alternatives (Andras, WIP) +15.8 Template restrictions (Andras, WIP) +15.9 Match operation (Andras, WIP) +15.11 Concatenating templates of string and list types (Andras, WIP) +16.1.2 Predefined functions (Andras, done: 71 new tests, 68 positive, 3 negative) +16.1.3 External functions (Andras, done: remove 2 tests from ATS) +19.1 Assignments (Andras, WIP) +19.3.2 The select union statement (Tomas, done: 11 new tests, 6 positive, 5 negative; 3 CRs) +19.9 The stop operation (Tomas, done: 2 new tests, 2 positive, 0 negative) +20.2 The alt statement (Tomas, done: 17 new tests, 1 positive, 16 negative; 2 CRs) +20.3 The repeat statement (Tomas, done: 3 new tests, 3 positive, 0 negative) +20.4 The interleave statement (Tomas, done: 12 new tests, 1 positive, 11 negative) +20.5.2 The activate operation (Tomas, done: 4 new tests, 2 positive, 2 negative) +20.5.3 The deactivate operation (Tomas, done: no change needed) +21.1.1 The connect and map operations (Tomas, done: 7 new tests, 0 positive, 7 negative) +21.1.2 The disconnect and unmap operations (Tomas, done: 7 new tests, 0 positive, 7 negative) +21.2.1 Test case stop operation (Tomas, done: no change needed) +21.3.1 The create operation (Tomas, done: no change needed) +21.3.2 The start operation (Tomas, done: 19 new tests, 9 positive, 10 negative; 1 CR) +21.3.3 The stop operation (Tomas, done: 13 new tests, 9 positive, 4 negative) +21.3.4 The kill operation (Tomas, done: 7 new tests, 2 positive, 5 negative) +21.3.5 The alive operation (Tomas, done: 1 new test (negative); added not validated tests from STF 470) +21.3.6 The running operation (Tomas, done: 1 new test (negative); added not validated tests from STF 470) +21.3.7 The done operation (Tomas, done: 5 new tests, 1 positive, 4 negative; added not validated tests from STF 470) +21.3.8 The killed operation (Tomas, done: 5 new tests, 1 positive, 4 negative; added not validated tests from STF 470) +22.2.1 The send operation (Tomas, done: 10 new tests, 3 positive, 7 negative) +22.2.2 The receive operation (Tomas, done: 45 new tests, 23 positive, 22 negative; 2 CR) +22.2.3 The trigger operation (Tomas, done: 44 new tests, 22 positive, 22 negative) +22.3.1 The call operation (Tomas, done: 15 new tests, 6 positive, 9 negative) +22.3.2 The getcall operation (Tomas, done: 2 new tests, 0 positive, 2 negative) +22.3.3 The reply operation (Tomas, done: 2 new tests, 0 positive, 2 negative) +22.3.2 The getreply operation (Tomas, done: 27 new tests, 12 positive, 15 negative) +22.3.5 The raise operation (Tomas, done: 13 new tests, 4 positive, 9 negative; 1 CR) +22.3.6 The catch operation (Tomas, done: 15 new tests, 6 positive, 9 negative) +22.4 The check operation (Tomas, done: 3 new tests, 0 positive, 3 negative) +22.5.1 The clear port operation (Tomas, done: no change needed) +22.5.2 The start port operation (Tomas, done: no change needed) +22.5.3 The stop port operation (Tomas, done: no change needed) +22.5.4 The halt port operation (Tomas, done: no change needed) +22.5.5 The checkstate port operation (Tomas, done: no change needed) +23.2 The start timer operation (Tomas, done: no change needed) +23.3 The stop timer operation (Tomas, done: no change needed) +23.4 The read timer operation (Tomas, done: no change needed) +23.2 The running timer operation (Tomas, done: added corrected version of not validated test from STF 470, otherwise no change needed) +23.2 The timeout operation (Tomas, done: 1 new test (positive); added corrected version of not validated tests from STF 470) +24.2 The setverdict operation (Tomas, done: no change needed) +24.3 The getverdict operation (Tomas, done: no change needed) +25 External actions (Tomas, done: no change needed) +26.1 The execute statement (Tomas, done: no change needed) +B.1.2.2 Complemented template list (Andras, WIP) +B.1.2.6 SuperSet (Andras, WIP) +B.1.2.7 SubSet (Andras, WIP) +B.1.2.9 Matching decoded content (Andras, WIP) +B.1.3.3 Permutation (Andras, WIP) +B.1.5 Matching character pattern (Andras, done: 5 new tests, 4 positive, 1 negative) +B.1.5.6 Case insensitive pattern matching (Andras, done: 2 new tests, 2 positive) +C.1.31 Octetstring to universal character string (Andras, implemented in 16.1.2) +C.1.32 Universal character string to octetstring (Andras, implemented in 16.1.2) +C.1.33 Value or template to universal charstring (Andras, implemented in 16.1.2) +C.3.3 The IsValue function (Andras, implemented in 16.1.2) +C.3.5 Matching mechanism detection (Andras, implemented in 16.1.2) +C.4.1 The Regexp function (Andras, implemented in 16.1.2) +C.4.2 The Substring function (Andras, implemented in 16.1.2) +C.4.3 The Replace function (Andras, implemented in 16.1.2) +C.5.5 Retrieving the type of string encoding (Andras, implemented in 16.1.2) +C.5.6 Removing BOMs of UCS encoding schemes (Andras, implemented in 16.1.2) +C.6.1 The random number generator function (Andras, implemented in 16.1.2) + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f5fca6d49b70c6fa3901f69e91fc8d557e069f6 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.1, Verify that schema with target namespace is correctly translated into single module + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A single XML Schema may be composed of a single or several schema element information +// items, and shall be translated to one or more TTCN-3 modules, corresponding to schema +// components that have the same target namespace. For XSD schemas with the same target +// namespace (including absence of the target namespace) exactly one TTCN-3 module shall +// be generated. + +module Pos_050101_namespaces_001 { + + import from schema_Pos_050101_namespaces_001 language "XSD" all; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050101_namespaces_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050101_namespaces_001.xml", { "Pos_050101_namespaces_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050101_namespaces_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..a79f1fdf6dd81625901004aab244da7b28ed26da --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d102f3d3557e556887fb5ab51cf2e1cf91e61568 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_001/Pos_050101_namespaces_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2bf18453a278a431e2b7245932c694c441d1c57 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.1, Verify schema with no target namespace is correctly translated into single module + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A single XML Schema may be composed of a single or several schema element information +// items, and shall be translated to one or more TTCN-3 modules, corresponding to schema +// components that have the same target namespace. For XSD schemas with the same target +// namespace (including absence of the target namespace) exactly one TTCN-3 module shall +// be generated. +// The names of the TTCN 3 modules generated based on this clause shall be the result of +// applying the name transformation rules in clause 5.2.2 to ... the predefined name +// "NoTargetNamespace". + +module Pos_050101_namespaces_002 { + + import from NoTargetNamespace language "XSD" all; + + template MyType m_msg := 2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050101_namespaces_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050101_namespaces_002.xml", { "Pos_050101_namespaces_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050101_namespaces_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6423a76f59437f6e69ae0c484268f350d988813 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xml @@ -0,0 +1,2 @@ + +2 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a0291684d45609f34cb06c752c3b8bf4af98f6a4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_002/Pos_050101_namespaces_002.xsd @@ -0,0 +1,5 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3010b05ca80fe909c0348429b043f160b94bc9e5 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.1, Verify that two schemas with the same target namespace are correctly translated + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A single XML Schema may be composed of a single or several schema element information +// items, and shall be translated to one or more TTCN-3 modules, corresponding to schema +// components that have the same target namespace. For XSD schemas with the same target +// namespace (including absence of the target namespace) exactly one TTCN-3 module shall +// be generated. +module Pos_050101_namespaces_003 { + + import from schema_Pos_050101_namespaces_003 language "XSD" all; + + template MyType m_msg := 3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050101_namespaces_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050101_namespaces_003.xml", { "test_data/Pos_050101_namespaces_003_merged.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050101_namespaces_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..70476acd4f701a4d6340c570e540d068ca49b850 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xml @@ -0,0 +1,2 @@ + +3 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..038f6ff7bb947b4613026988e43a412f19576191 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ee7a323c52218a3f66e79689ddf553eb087a3627 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/Pos_050101_namespaces_003_1.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/XmlDiff.log b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/XmlDiff.log new file mode 100644 index 0000000000000000000000000000000000000000..52ff94709020080478090765d8cf9408d9851b1e --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/XmlDiff.log @@ -0,0 +1,114 @@ + + + + + 2015-10-05T15:13:38 + 1444047218167 + 0 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + <init> + 18 + XmlDiff.java:101:Reference file: C:\SVN\SVN 475\trunk\ATS\06_built_in_data_types\0601_mapping_of_facets\060101_length\Pos_060101_length_002\Pos_060101_length_002.xml, xsd file names: [Pos_060101_length_002.xsd], xsd search path: null + + + 2015-10-05T15:13:38 + 1444047218326 + 1 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + findXsdFiles + 18 + XmlDiff.java:248:Looking for XSD file Pos_060101_length_002.xsd + + + 2015-10-05T15:13:38 + 1444047218327 + 2 + SEVERE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + <init> + 18 + XmlDiff.java:124:Missing XSD files [Pos_060101_length_002.xsd] in search path null + + + + + + + 2017-04-03T15:17:08 + 1491221828805 + 0 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + <init> + 17 + XmlDiff.java:101:Reference file: C:\Work\STF\STF 521\Tmp\05_mapping_xml_schemas\0501_namespaces\050101_namespaces\Pos_050101_namespaces_003\Pos_050101_namespaces_003.xml, xsd file names: [test_data/Pos_050101_namespaces_003_merged.xsd], xsd search path: null + + + 2017-04-03T15:17:09 + 1491221829023 + 1 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + findXsdFiles + 17 + XmlDiff.java:248:Looking for XSD file test_data/Pos_050101_namespaces_003_merged.xsd + + + 2017-04-03T15:17:09 + 1491221829294 + 2 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + diff + 17 + XmlDiff.java:140:Looking for difference: reference file C:\Work\STF\STF 521\Tmp\05_mapping_xml_schemas\0501_namespaces\050101_namespaces\Pos_050101_namespaces_003\Pos_050101_namespaces_003.xml, input {<?xml version="1.0" encoding="utf-8"?> +<ns1:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="schema:Pos_050101_namespaces_003">3</ns1:MyType>} + + + 2017-04-03T15:17:09 + 1491221829726 + 3 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + diff + 17 + XmlDiff.java:155:No differences found between reference file C:\Work\STF\STF 521\Tmp\05_mapping_xml_schemas\0501_namespaces\050101_namespaces\Pos_050101_namespaces_003\Pos_050101_namespaces_003.xml and input {<?xml version="1.0" encoding="utf-8"?> +<ns1:MyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="schema:Pos_050101_namespaces_003">3</ns1:MyType>} + + + + + + + 2017-04-04T12:33:32 + 1491298412165 + 0 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + <init> + 18 + XmlDiff.java:101:Reference file: C:\Work\STF\STF 521\Tmp\07_mapping_xsd_components\0707_any_and_anyattribute\070701_the_any_element\Pos_070701_the_any_element_001\Pos_070701_the_any_element_001.xml, xsd file names: [Pos_070701_the_any_element_001.xsd], xsd search path: null + + + 2017-04-04T12:33:32 + 1491298412455 + 1 + FINE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + findXsdFiles + 18 + XmlDiff.java:248:Looking for XSD file Pos_070701_the_any_element_001.xsd + + + 2017-04-04T12:33:32 + 1491298412456 + 2 + SEVERE + org.etsi.mts.ttcn.part9.xmldiff.XmlDiff + <init> + 18 + XmlDiff.java:124:Missing XSD files [Pos_070701_the_any_element_001.xsd] in search path null + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/test_data/Pos_050101_namespaces_003_merged.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/test_data/Pos_050101_namespaces_003_merged.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6955c12864372db11e7434f7bb102ca0fdaed9cd --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_003/test_data/Pos_050101_namespaces_003_merged.xsd @@ -0,0 +1,13 @@ + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bb45c7f5e1de522a88784f522335825edf34ab64 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.1, Verify that two schemas with no target namespace are correctly translated + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A single XML Schema may be composed of a single or several schema element information +// items, and shall be translated to one or more TTCN-3 modules, corresponding to schema +// components that have the same target namespace. For XSD schemas with the same target +// namespace (including absence of the target namespace) exactly one TTCN-3 module shall +// be generated. +// The names of the TTCN 3 modules generated based on this clause shall be the result of +// applying the name transformation rules in clause 5.2.2 to ... the predefined name +// "NoTargetNamespace". + +module Pos_050101_namespaces_004 { + + import from NoTargetNamespace language "XSD" all; + + template MyType m_msg := 4; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050101_namespaces_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050101_namespaces_004.xml", { "test_data/Pos_050101_namespaces_004_merged.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050101_namespaces_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa4ad732b33216e9449830f30a265e2885b35cd7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml @@ -0,0 +1,2 @@ + +4 diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..09dc725a033d39ccc0c05d3113ddd3e7872c0330 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xsd @@ -0,0 +1,4 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1969efeb7c2fa86898aacd1b90c4256c20bca056 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004_1.xsd @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/test_data/Pos_050101_namespaces_004_merged.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/test_data/Pos_050101_namespaces_004_merged.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f1099ca389a1df5c3f1195d10a6383428c7891c9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050101_namespaces/Pos_050101_namespaces_004/test_data/Pos_050101_namespaces_004_merged.xsd @@ -0,0 +1,5 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02bfbaa1a20fa853e2ba711ac396aa1590610bbf --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.2, Test inclusion of a schema with the same namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// XSD include element information items shall be ignored if the included schema element has the same target +// namespace as the including one (implying the absence of the target namespace). + +module Pos_050102_includes_001 { + + import from schema_Pos_050102_includes_001 language "XSD" all; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050102_includes_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050102_includes_001.xml", { "Pos_050102_includes_001.xsd", "Pos_050102_includes_001_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050102_includes_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..42f7278bdc8240fe066eb5829a95f87d34346174 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..97c302167de98cbb94675d1a62a437db24401752 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001.xsd @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8f3fadc4cad184fbf39332c2cd6a05b30b95c861 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_001/Pos_050102_includes_001_1.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a6686a29cba530e898cefef5f9171f2ab4b13a8 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.2, Verify that included schema with no target namespace is transformed twice (inclusion) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the included schema element has no target namespace but the including schema has +// (i.e. it is not absent), all definitions of the included schema shall be mapped twice, +// i.e. the resulted TTCN-3 definitions shall be inserted to the TTCN-3 module generated +// for the schema element(s) with no target namespace as well as to the module generated +// for the schema element(s) with the target namespace of the including schema. + +module Pos_050102_includes_002 { + + import from schema_Pos_050102_includes_002 language "XSD" all; + + template MyType m_msg := 2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050102_includes_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050102_includes_002.xml", { "Pos_050102_includes_002.xsd", "Pos_050102_includes_002_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050102_includes_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..72cd21a5ad9e153bb8559376513c53270aed0f6a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xml @@ -0,0 +1,2 @@ + +2 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8ed2d19b4dd539510d92cfa2f10a8670ff0c45a5 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002.xsd @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..97e4e32f1e73c228b2509567fe62e208c682c14b --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_002/Pos_050102_includes_002_1.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0c2ffae5e7983be517ec4ca26d1e03ae96cdfcc --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.2, Verify that included schema with no target namespace is transformed twice (no namespace) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the included schema element has no target namespace but the including schema has +// (i.e. it is not absent), all definitions of the included schema shall be mapped twice, +// i.e. the resulted TTCN-3 definitions shall be inserted to the TTCN-3 module generated +// for the schema element(s) with no target namespace as well as to the module generated +// for the schema element(s) with the target namespace of the including schema. + +module Pos_050102_includes_003 { + + import from NoTargetNamespace language "XSD" all; + + template MyType m_msg := 3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050102_includes_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050102_includes_003.xml", { "Pos_050102_includes_003.xsd", "Pos_050102_includes_003_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050102_includes_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..cba20604ecc41f537609bb7282fc291a36eabdbe --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xml @@ -0,0 +1,2 @@ + +3 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2bdfe5258d6ec72ed482a630479f4534d465ba4d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003.xsd @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0d351875f62cbdeb4a34b904d3d8df013e80cf49 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050102_includes/Pos_050102_includes_003/Pos_050102_includes_003_1.xsd @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a2d004fc3bea5cdcc7ad3e890a08998e99266590 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.3, Verify that it is not allowed to import imports from XSD schemas + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// It is not allowed to import XSD import statements to TTCN-3 (i.e. there is no transitive import +// of XSD import statements as defined for TTCN-3, see clause 8.2.3.7 of ES 201 873-1 [1]). + +module Neg_050103_imports_001 { + + import from schema_Neg_050103_imports_001 language "XSD" { import all }; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_050103_imports_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_050103_imports_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3a6696577e57d4fe5af9fb1254316780938865ee --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001.xsd @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ab84a427cdbb944318a966ddcd091fcd5001daea --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Neg_050103_imports_001/Neg_050103_imports_001_1.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1f8b3efa5a016e78ee1be747d24f89b8b9b3d33a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.3, Verify that XSD import statement is handled correctly + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// All XSD import statements (i.e. import element information items and the related xmlns attributes, +// where present) shall be mapped to equivalent TTCN-3 import statements, importing all definitions +// from the other TTCN-3 module. All XSD components are public by default (see clause 8.2.3 of +// ES 201 873-1 [1]). + +// Note: It is not possible to verify presence of the import clause in the generated code directly +// since XSD import statements cannot be imported. This test only tests if XSD schema containing +// an import element is processed correctly. + +module Pos_050103_imports_001 { + + import from schema_Pos_050103_imports_001 language "XSD" all; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050103_imports_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050103_imports_001.xml", { "Pos_050103_imports_001.xsd", "Pos_050103_imports_001_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050103_imports_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..939def1db59d32a554a5ad39b503209299ac4c65 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e07a690eae0b03407aec99af7134a7a9ebace473 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001.xsd @@ -0,0 +1,8 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001_1.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e3e9d58f5d8c0dab52b0c9a08d54e72937293cb9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050103_imports/Pos_050103_imports_001/Pos_050103_imports_001_1.xsd @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c9da9c08f31505d054cbcfc8a11d64e9a572a86d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that qualified default element form is correctly processed (no namespace prefix) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the TTCN-3 module corresponds to a (present) target namespace and the value of the ... +// elementFormDefault attributes of any schema element information items that contribute to +// the given TTCN-3 module is qualified, the encoding instructions ... "elementFormQualified" +// shall be attached accordingly to the given TTCN-3 module. +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. + +module Pos_050104_attributes_of_the_xsd_schema_element_001 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_001 language "XSD" all; + + template MyType m_msg := + { + item1 := "abc", + item2 := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_001.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c18cb49afb3832d61103f2add225321f5ea75990 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xml @@ -0,0 +1,5 @@ + + + abc + def + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..78aa7df5a30e2ca1d42bb18f938610b8e6d7091b --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_001/Pos_050104_attributes_of_the_xsd_schema_element_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4e9feb879c9077bb43d2328e9467770027a1aac --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that qualified default element form is correctly processed (namespace prefix used) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the TTCN-3 module corresponds to a (present) target namespace and the value of the ... +// elementFormDefault attributes of any schema element information items that contribute to +// the given TTCN-3 module is qualified, the encoding instructions ... "elementFormQualified" +// shall be attached accordingly to the given TTCN-3 module. +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. +module Pos_050104_attributes_of_the_xsd_schema_element_002 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_002 language "XSD" all; + + template MyType m_msg := + { + item1 := "abc", + item2 := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_002.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..c525cbdda0123f48f83519e31bf5415d2a0a85aa --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xml @@ -0,0 +1,5 @@ + + + abc + def + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a2fd3ee341077202f8b29fa81e2509f4576178cb --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_002/Pos_050104_attributes_of_the_xsd_schema_element_002.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..abf63cb9d7e83624ce5a1b99797d168964b703f9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that unqualified default element form is correctly processed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// All fields of TTCN-3 definitions in the given TTCN-3 module corresponding to local +// element declarations or element and model group references in schema element information +// items with the value of its elementFormDefault attribute unqualified (explicitly or +// implicitly via defaulting) shall be supplied with the "form as unqualified" encoding +// instruction, unless a form attribute of the given declaration requires differently +// (see clause 7.1.6). +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. +module Pos_050104_attributes_of_the_xsd_schema_element_003 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_003 language "XSD" all; + + template MyType m_msg := + { + item1 := "abc", + item2 := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_003.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..71a3812408417a66679f92f8abb6d6bad16444f7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xml @@ -0,0 +1,5 @@ + + + abc + def + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d6b48c0be36407ec3675c8e42e49c2e9a56632e0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_003/Pos_050104_attributes_of_the_xsd_schema_element_003.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7bdea5074adbe2ac86514f6a696ae3741b31e3e8 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that qualified default attribute form is correctly processed (no namespace prefix) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the TTCN-3 module corresponds to a (present) target namespace and the value of the +// attributeFormDefault ... attribute of any schema element information items that contribute +// to the given TTCN-3 module is qualified, the encoding instructions "attributeFormQualified" +// ... shall be attached accordingly to the given TTCN-3 module. +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. +module Pos_050104_attributes_of_the_xsd_schema_element_004 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_004 language "XSD" all; + + template MyType m_msg := + { + item := "abc", + attr := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_004.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..2adbe415d5c30a906269869eb244bf783aeedb8c --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xml @@ -0,0 +1,4 @@ + + + abc + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6542e37297b06740df470e153e7ed34cdae467e4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_004/Pos_050104_attributes_of_the_xsd_schema_element_004.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d78e64f19244b2a26519f8a228ccaf1e185a8755 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that qualified default attribute form is correctly processed (namespace prefix used) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the TTCN-3 module corresponds to a (present) target namespace and the value of the +// attributeFormDefault ... attribute of any schema element information items that contribute +// to the given TTCN-3 module is qualified, the encoding instructions "attributeFormQualified" +// ... shall be attached accordingly to the given TTCN-3 module. +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. +module Pos_050104_attributes_of_the_xsd_schema_element_005 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_005 language "XSD" all; + + template MyType m_msg := + { + item := "abc", + attr := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_005.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..b19190ef97585e8550374d0e82db72e707a855e0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xml @@ -0,0 +1,4 @@ + + + abc + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..24c65a88f19a27c35684202672353310d01b81d5 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_005/Pos_050104_attributes_of_the_xsd_schema_element_005.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.ttcn b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3374a95b962809c35e58ddcf997ea7083810bcb4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.1.4, Verify that unqualified default attribute form is correctly processed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// All fields of TTCN-3 definitions in the given TTCN 3 module corresponding to local +// attribute declarations or to attribute and attributeGroup references in schema element +// information items with the value of its attributeFormDefault attribute being unqualified +//(explicitly or implicitly via defaulting) shall be supplied with the "form as unqualified" +// encoding instruction, unless a form attribute of the given declaration requires +// differently (see clause 7.1.6). +// +// Note: as only end-to-end solution is tested, the presence of encoding attributes is not +// checked directly, but through the encoded messages. +module Pos_050104_attributes_of_the_xsd_schema_element_006 { + + import from schema_Pos_050104_attributes_of_the_xsd_schema_element_006 language "XSD" all; + + template MyType m_msg := + { + item := "abc", + attr := "def" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050104_attributes_of_the_xsd_schema_element_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050104_attributes_of_the_xsd_schema_element_006.xml", { "Pos_050104_attributes_of_the_xsd_schema_element_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050104_attributes_of_the_xsd_schema_element_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..5385d64e016dd9291dbd0c7bfb698b101ff69620 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xml @@ -0,0 +1,4 @@ + + + abc + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xsd b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6e3894af654a645b1973a3f7218e1823c8c47168 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces/050104_attributes/Pos_050104_attributes_of_the_xsd_schema_element_006/Pos_050104_attributes_of_the_xsd_schema_element_006.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml b/ATS/xml/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa4ad732b33216e9449830f30a265e2885b35cd7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0501_namespaces_and_document_references/050101_namespaces/Pos_050101_namespaces_004/Pos_050101_namespaces_004.xml @@ -0,0 +1,2 @@ + +4 diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b643fee09f436f9d8b040c9e590d27e3b0e4f0c4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify conversion of symbols into U+005f (low line) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule b: +// the characters " " (SPACE), "." (FULL STOP), "-" (HYPEN-MINUS), ":" (COLON) and "/" +// (SOLIDUS) shall all be replaced by a "_" (LOW LINE); +module Pos_050202_name_conversion_rules_001 { + + import from schema_Pos_050202_name_conversion_rules_001_test language "XSD" all; + + template A_b_c m_src := + { + d_e_f := 1, + g_h_i := 2 + }; + template MyType m_msg := m_src; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_001.xml", { "Pos_050202_name_conversion_rules_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..b988e2aabc8f2345da01141655e3b4f839b02fac --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fabd8a8dae76c059edbe190dc130a7c66bab2e5c --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_001/Pos_050202_name_conversion_rules_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc025e772d87de3703370b4e1f4aca32c8e6096d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that non-ASCI letters are not present in transforming identifiers + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule c: +// any character except "A" to "Z" (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z), +// "a" to "z" (LATIN SMALL LETTER A to LATIN SMALL LETTER Z), "0" to "9" (DIGIT ZERO +// to DIGIT NINE), and "_" (LOW LINE) shall be removed; +module Pos_050202_name_conversion_rules_002 { + import from schema_Pos_050202_name_conversion_rules_002 language "XSD" all; + + template Xx m_src := + { + aa := 1, + bb := 2 + }; + template MyType m_msg := m_src; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_002.xml", { "Pos_050202_name_conversion_rules_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba0b7b284d5b5f2172534477d27772cd77242768 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..20003f19134e207aad7447e111d5f40165cb5807 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_002/Pos_050202_name_conversion_rules_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7a485cc09f299d43320d8cc5d9f07f8aef18dcff --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that multiple "_" are simplified in transforming identifiers + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule d: +// a sequence of two or more "_" (LOW LINE) characters shall be replaced with +// a single "_" (LOW LINE); +module Pos_050202_name_conversion_rules_003 { + + import from schema_Pos_050202_name_conversion_rules_003 language "XSD" all; + + template A_b m_src := + { + c_d := 1, + e_f := 2 + }; + template MyType m_msg := m_src; + + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_003.xml", { "Pos_050202_name_conversion_rules_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..f5c4074badbb6ee34d254f93d9d43e0ac41aa9cc --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c4ecd1fece34398fc2f79000cd917d090eec84d4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_003/Pos_050202_name_conversion_rules_003.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5874cc291e41dc3d0f2aa833ea2a93c135fde9d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:5.2.2, Verify that leading and trailing low lines are removed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule e: +// "_" (LOW LINE) characters occurring at the beginning or at the end of the name shall +// be removed; +module Pos_050202_name_conversion_rules_004 { + + import from schema_Pos_050202_name_conversion_rules_004 language "XSD" all; + + template Abc m_src := + { + def := 1, + ghi := 2 + }; + template MyType m_msg := m_src; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_004.xml", { "Pos_050202_name_conversion_rules_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..8effe763ededf23a7da3f366643cdc1f15a49867 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xml @@ -0,0 +1,4 @@ + + + <__def>1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..de348d0a06c62019602e049fc5feba5913e14e88 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_004/Pos_050202_name_conversion_rules_004.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f9bdf7853ea0091513b0b09fba159d53faf2036 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that type names are capitalized + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule f: +// if a character string that is to be used as a name of a TTCN-3 type starts with +// a lower-case letter, the first letter shall be capitalized (converted to upper-case); +module Pos_050202_name_conversion_rules_005 { + + import from schema_Pos_050202_name_conversion_rules_005 language "XSD" all; + + template MyType m_msg := 5; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_005.xml", { "Pos_050202_name_conversion_rules_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..39a88a17b65693fec4083c9a49d0cf2e882184cc --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c7d8f433b3a913be180393c099680e9263ccbeed --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_005/Pos_050202_name_conversion_rules_005.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b4bc2af37d462af0effbf93b6720a8e34bb8159a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that prefixing type names with "X" works correctly + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule f: +// If [a character string that is to be used as a name of a TTCN-3 type] starts with +// a digit (DIGIT ZERO to DIGIT NINE), it shall be prefixed with an "X" (LATIN CAPITAL +// LETTER X) character; +module Pos_050202_name_conversion_rules_006 { + + import from schema_Pos_050202_name_conversion_rules_006 language "XSD" all; + + template X01MyType m_msg := 6; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_006.xml", { "Pos_050202_name_conversion_rules_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1721fded19cbcef079b785b30cc25fcfba86acd --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xml @@ -0,0 +1,2 @@ + +6 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..82534d3582d6afc3c55c39198d7c3e6413cde7ac --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_006/Pos_050202_name_conversion_rules_006.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c52573a5902e9ac2931997c1c9a7d2f46c8b1e82 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that names of field of structure types are uncapitalized + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule g: +// if a character string that is to be used as an identifier of a structured type field +// ... starts with an upper-case letter, the first letter shall be uncapitalized +// (converted to lower-case); +module Pos_050202_name_conversion_rules_007 { + + import from schema_Pos_050202_name_conversion_rules_007 language "XSD" all; + + template MyType m_msg := + { + abc := 1, + def := 2 + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_007.xml", { "Pos_050202_name_conversion_rules_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..515240aee2f24a6f15cd1ffcb157908ef6beafe8 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..060493571d4cefad0e21585e961d279382c961e9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_007/Pos_050202_name_conversion_rules_007.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fce6ef177caaf332496f2131f14d4f6c8cf2bdc3 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that names of enumerated items are uncapitalized + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule g: +// if a character string that is to be used as an identifier of a structured ... +// enumeration value starts with an upper-case letter, the first letter shall be +// uncapitalized (converted to lower-case); +module Pos_050202_name_conversion_rules_008 { + + import from schema_Pos_050202_name_conversion_rules_008 language "XSD" all; + + template MyType m_msg := indigo; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_008.xml", { "Pos_050202_name_conversion_rules_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_008(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f1981ddd95f5452dd8dc6632db1442dc1b8d58a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xml @@ -0,0 +1,2 @@ + +Indigo \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xsd new file mode 100644 index 0000000000000000000000000000000000000000..13f3d1d63e3669c22c1c996295e22a9291ed4925 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_008/Pos_050202_name_conversion_rules_008.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..46c85e6f0f1386ece220ceb02c3a4ea19ea4d0e0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that prefixing field names of structured types with "x" works correctly + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule g: +// if [a character string that is to be used as an identifier of a structured type field] +// starts with a digit (DIGIT ZERO to DIGIT NINE), it shall be prefixed with an "x" +// (LATIN SMALL LETTER X) character; +module Pos_050202_name_conversion_rules_009 { + + import from schema_Pos_050202_name_conversion_rules_009 language "XSD" all; + + template MyType m_msg := + { + x01abc := 1, + x02def := 2 + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_009() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_009.xml", { "Pos_050202_name_conversion_rules_009.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_009(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xml new file mode 100644 index 0000000000000000000000000000000000000000..b53d8a9217a56d9de7bd199d18dd3a3d80ccd75a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xml @@ -0,0 +1,4 @@ + + + <中国01abc>1 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xsd new file mode 100644 index 0000000000000000000000000000000000000000..465afd98503db8ca4e77db4d11e8888a8504db59 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_009/Pos_050202_name_conversion_rules_009.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f6dcd0971520a97de4ceca141b826d3121adbbb --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that prefixing enumerated items with "x" works correctly + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule g: +// if [a character string that is to be used as an identifier of an enumerated item] +// starts with a digit (DIGIT ZERO to DIGIT NINE), it shall be prefixed with an "x" +// (LATIN SMALL LETTER X) character; +module Pos_050202_name_conversion_rules_010 { + + import from schema_Pos_050202_name_conversion_rules_010 language "XSD" all; + + template MyType m_msg := x02_orange; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_010() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_010.xml", { "Pos_050202_name_conversion_rules_010.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_010(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xml new file mode 100644 index 0000000000000000000000000000000000000000..75e68cd4d4ea2fb7a5c0510ae5b3e9d773a63691 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xml @@ -0,0 +1,2 @@ + +橙色02_orange \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f863d88f116a5350329056820f8841cf2bf22b79 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_010/Pos_050202_name_conversion_rules_010.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4de06a5a8580decedb374d3a1a0a9ae3f34e861d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Check transformation of empty type identifier into "X" + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule h: +// if a character string that is to be used as a name of a TTCN-3 type definition or as +// a type reference name is empty, it shall be replaced by "X" (LATIN CAPITAL LETTER X); +module Pos_050202_name_conversion_rules_011 { + + import from schema_Pos_050202_name_conversion_rules_011 language "XSD" all; + + template X m_msg := "世界,你好!"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_011() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_011.xml", { "Pos_050202_name_conversion_rules_011.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_011(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xml new file mode 100644 index 0000000000000000000000000000000000000000..95dc86499ba9a1d149edae0c5d132a5bd3471ba8 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xml @@ -0,0 +1,2 @@ + +世界,你好! \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0da0c0c59e886db2e8472d8f452314e77b26dbd0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_011/Pos_050202_name_conversion_rules_011.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7cffb2b4d683ac611db86078528a099244018ed8 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Check transformation of empty structured field identifier into "x" + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule i: +// if a character string that is to be used a name of a record ... field ... is empty, it +// shall be replaced by "x" (LATIN SMALL LETTER X). +module Pos_050202_name_conversion_rules_012 { + + import from schema_Pos_050202_name_conversion_rules_012 language "XSD" all; + + template MyType m_msg := { x := "孔子" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_012() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_012.xml", { "Pos_050202_name_conversion_rules_012.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_012(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xml new file mode 100644 index 0000000000000000000000000000000000000000..ffed47c78356f962059dff32e252f917ce030069 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xml @@ -0,0 +1,4 @@ + + + <名称>孔子 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xsd new file mode 100644 index 0000000000000000000000000000000000000000..09c563989c6ebed708dfb26853de8daf887dabe7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_012/Pos_050202_name_conversion_rules_012.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cdd21478ee18ce81dffafdbb5c04609b43922ae4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Check transformation of empty enumerated value into "x" + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule i: +// if a character string that is to be used a name of ... [an] enumeration value +// is empty, it shall be replaced by "x" (LATIN SMALL LETTER X). +module Pos_050202_name_conversion_rules_013 { + + import from schema_Pos_050202_name_conversion_rules_013 language "XSD" all; + + template MyType m_msg := x; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_013() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_013.xml", { "Pos_050202_name_conversion_rules_013.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_013(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xml new file mode 100644 index 0000000000000000000000000000000000000000..fec2709c9591c167a5974bb1f2e2c2a54fe1fa67 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xml @@ -0,0 +1,2 @@ + +中文 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b4f678919225af1aff54709011d40c885c69f9de --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_013/Pos_050202_name_conversion_rules_013.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23ea6a13f2ffc896c36c0c9616c355eda3a8a82f --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that additional suffices are attached in case of name clashes between types + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule j: +// If the name being generated is the name of a TTCN-3 type and the character string +// generated by items a) to i) above is identical to the name of another TTCN-3 type +// previously generated in the same TTCN-3 module, or is one of the reserved words +// specified in clause 11.27 of Recommendation ITU T X.680 [3], then a postfix shall +// be appended to the character string generated according to the above rules. The +// postfix shall consist of a "_" (LOW LINE) followed by the canonical lexical +// representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of an integer. This +// integer shall be the least positive integer such that the new name is different +// from the type reference name of any other TTCN-3 type assignment previously +// generated in any of those TTCN-3 modules. +module Pos_050202_name_conversion_rules_014 { + + import from schema_Pos_050202_name_conversion_rules_014 language "XSD" all; + + template MyType_2 m_msg := 1.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_014() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_014.xml", { "Pos_050202_name_conversion_rules_014.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_014(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xml new file mode 100644 index 0000000000000000000000000000000000000000..0476dc385f7b9f36a344f3224b548fb13962db72 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xml @@ -0,0 +1,2 @@ + +1.0 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bea557b6e0b8cf1959e34143abec1ff73dab410f --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_014/Pos_050202_name_conversion_rules_014.xsd @@ -0,0 +1,8 @@ + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3ffd0895f674e843194d79587d0d66a434802b5 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between types and local module + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule j (adaptation considering rules of 5.2.2 of the core language specification): +// If the name being generated is the name of a TTCN-3 type and the character string +// generated by items a) to i) above is identical to the name of another TTCN-3 type +// previously generated in the same TTCN-3 module, or is one of the reserved words +// specified in clause 11.27 of Recommendation ITU T X.680 [3], then a postfix shall +// be appended to the character string generated according to the above rules. The +// postfix shall consist of a "_" (LOW LINE) followed by the canonical lexical +// representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of an integer. This +// integer shall be the least positive integer such that the new name is different +// from the type reference name of any other TTCN-3 type assignment previously +// generated in any of those TTCN-3 modules. +module Pos_050202_name_conversion_rules_015 { + + import from MyType language "XSD" all; + + template MyType_1 m_msg := 15; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_015() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_015.xml", { "Pos_050202_name_conversion_rules_015.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_015(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xml new file mode 100644 index 0000000000000000000000000000000000000000..accea6db4212d2fb3950237df91691c09aa7d13d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xml @@ -0,0 +1,2 @@ + +15 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ad7be898f2590d4c6e4cb10e1a2e9290f6660296 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_015/Pos_050202_name_conversion_rules_015.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f79b534347d702f5e5e4c13f3edf527960ac23d --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between types and imported module + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule j (adaptation considering rules of 5.2.2 of the core language specification): +// If the name being generated is the name of a TTCN-3 type and the character string +// generated by items a) to i) above is identical to the name of another TTCN-3 type +// previously generated in the same TTCN-3 module, or is one of the reserved words +// specified in clause 11.27 of Recommendation ITU T X.680 [3], then a postfix shall +// be appended to the character string generated according to the above rules. The +// postfix shall consist of a "_" (LOW LINE) followed by the canonical lexical +// representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of an integer. This +// integer shall be the least positive integer such that the new name is different +// from the type reference name of any other TTCN-3 type assignment previously +// generated in any of those TTCN-3 modules. +module Pos_050202_name_conversion_rules_016 { + + import from schema_Pos_050202_name_conversion_rules_016 language "XSD" all; + + template MyType_1 m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_016() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_016.xml", { "Pos_050202_name_conversion_rules_016.xsd", "Pos_050202_name_conversion_rules_016_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_016(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xml new file mode 100644 index 0000000000000000000000000000000000000000..3381a461e6b0e91932392e10661344c02f301fba --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6ed81380c8214310581ba4113b184cf98c976a46 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016.xsd @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0e7a0cce84608b43cd0ccdfacf1bd965a12247d6 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_016/Pos_050202_name_conversion_rules_016_1.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cfa54f1ba8d2716fc0a52e55cce984a9dd4af5fc --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between field names + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// If the name being generated is the identifier of a field of a record or +// a union type, and the character string generated by the rules in items +// a) to i) above is identical to the identifier of a previously generated +// field identifier of the same type, then a postfix shall be appended to +// the character string generated by the above rules. The postfix shall +// consist of a "_" (LOW LINE) followed by the canonical lexical +// representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of +// an integer. This integer shall be the least positive integer such that +// the new identifier is different from the identifier of any previously +// generated component of that sequence, set, or choice type. +module Pos_050202_name_conversion_rules_017 { + + import from schema_Pos_050202_name_conversion_rules_017 language "XSD" all; + + template MyType m_msg := + { + item := 0, + item_1 := 1, + item_2 := 2 + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_017() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_017.xml", { "Pos_050202_name_conversion_rules_017.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_017(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f9bb1c689fe40e37baa9a26b15e92af81914dc7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xml @@ -0,0 +1,6 @@ + + + 0 + 1 + 2 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0fef5379dce6f35a65c9d4662e4986461932a6e7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_017/Pos_050202_name_conversion_rules_017.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..635c7ba08c7f6ab0f7de8905384d867c5f90091f --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between field name and keyword + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Field names that are one of the TTCN-3 keywords (see clause A.1.5 of ES 201 873 1 +// [1]) ... after applying the postfix to clashing field names, shall be suffixed by +// a single "_" (LOW LINE) character. +module Pos_050202_name_conversion_rules_018 { + + import from schema_Pos_050202_name_conversion_rules_018 language "XSD" all; + + template MyType m_msg := + { + choice:= { variant_ := 0 } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_018() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_018.xml", { "Pos_050202_name_conversion_rules_018.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_018(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec203e9f641ac49f924d041d5faf53980995af23 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xml @@ -0,0 +1,4 @@ + + + 0 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xsd new file mode 100644 index 0000000000000000000000000000000000000000..eb28d7a5dd5e7f2b64107d36a7c68c4dccec2a78 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_018/Pos_050202_name_conversion_rules_018.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..507b287b1eb403bd6d6add5f7ba20d9f669c21a0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between field name and predefined function + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Field names that are one of the ... names of predefined functions (see clause 16.1.2 of +// ES 201 873 1 [1]) after applying the postfix to clashing field names, shall be suffixed +// by a single "_" (LOW LINE) character. +module Pos_050202_name_conversion_rules_019 { + + import from schema_Pos_050202_name_conversion_rules_019 language "XSD" all; + + template MyType m_msg := + { + choice:= { rnd_ := 0 } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_019() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_019.xml", { "Pos_050202_name_conversion_rules_019.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_019(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xml new file mode 100644 index 0000000000000000000000000000000000000000..5031f3e374c9508e54b9bc0b583a9e64d9668082 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xml @@ -0,0 +1,4 @@ + + + 0 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xsd new file mode 100644 index 0000000000000000000000000000000000000000..317c04232bc1a9681859f2b915801f536e5155b7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_019/Pos_050202_name_conversion_rules_019.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f4c672829828db9b7bfcad60233bb8a5663685d6 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between enumerated items + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule l: +// If the name being generated is the identifier of an enumeration item +// (see clause 6.2.4 of ES 201 873 1 [1]) of an enumerated type, and the +// character string generated by the rules in items a) to i) above is +// identical to the identifier of another enumeration item previously +// generated in the same enumerated type, then a postfix shall be appended +// to the character string generated by the above rules. The postfix shall +// consist of a "_" (LOW LINE) followed by the canonical lexical +// representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of +// an integer. This integer shall be the least positive integer such that +// the new identifier is different from the identifier in any other +// enumeration item already present in that TTCN-3 enumerated type. +module Pos_050202_name_conversion_rules_020 { + + import from schema_Pos_050202_name_conversion_rules_020 language "XSD" all; + + template MyType m_msg := red_1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_020() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_020.xml", { "Pos_050202_name_conversion_rules_020.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_020(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xml new file mode 100644 index 0000000000000000000000000000000000000000..c2b303269e4874cf5157b44d94e6e9e0dcc5c019 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xml @@ -0,0 +1,2 @@ + +红色red \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f6cdbcf8d20bf2055f3813206c2d83023ee13e87 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_020/Pos_050202_name_conversion_rules_020.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f368838985e3d82278d15e962a85a9f8826b06a6 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between enumerated item and keyword + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Enumeration names that are one of the TTCN-3 keywords (see clause A.1.5 +// of ES 201 873 1 [1]) ... after applying the postfix to clashing enumeration +// names, shall be suffixed by a single "_" (LOW LINE) character. +module Pos_050202_name_conversion_rules_021 { + + import from schema_Pos_050202_name_conversion_rules_021 language "XSD" all; + + template MyType m_msg := on_; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_021() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_021.xml", { "Pos_050202_name_conversion_rules_021.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_021(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b790095aac78b1a1de51c89333f68697d5fdca1 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xml @@ -0,0 +1,2 @@ + +on \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f52b52c355b3f01efbb594ffd751cc41ab73d666 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_021/Pos_050202_name_conversion_rules_021.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6f8d5091ba9a247a67ba92e675b9d1f0a44155f2 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Verify that suffix is attached in case of name clash between enumerated item and predefined function + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule k: +// Enumeration names that are one of the ... names of predefined functions +// (see clause 16.1.2 of ES 201 873 1 [1])after applying the postfix to clashing +// enumeration names, shall be suffixed by a single "_" (LOW LINE) character. +module Pos_050202_name_conversion_rules_022 { + + import from schema_Pos_050202_name_conversion_rules_022 language "XSD" all; + + template MyType m_msg := rnd_; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_022() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_022.xml", { "Pos_050202_name_conversion_rules_022.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_022(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xml new file mode 100644 index 0000000000000000000000000000000000000000..628c0f4e025515cd6ee7883c433697798c6c7da0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xml @@ -0,0 +1,2 @@ + +rnd \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xsd new file mode 100644 index 0000000000000000000000000000000000000000..18d5aa64beecb30559734a94565c51b4a343ddc0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_022/Pos_050202_name_conversion_rules_022.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fbeee790eff5b47d608b65e4e5099cf145517ea0 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:5.2.2, Verify that name clash between module names is resolved using suffix + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule a: If the name being generated is the name of a TTCN-3 module and the character +// string generated by items a) to e) above is identical to an another, previously +// generated TTCN-3 module name, then a postfix shall be appended to the character +// string: the postfix shall consist of a "_" (LOW LINE) followed by the canonical +// lexical representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of an integer, +// unless the name already finishes with a "_" (LOW LINE) character, in which case the +// postfix is an integer only. This integer shall be the least positive integer such +// that the new name is different from all previously generated TTCN 3 modules names +// and clashing definition name. + +module Pos_050202_name_conversion_rules_023 { + + import from schema_Pos_050202_name_conversion_rules_023_ language "XSD" all; + import from schema_Pos_050202_name_conversion_rules_023_1 language "XSD" all; + + template schema_Pos_050202_name_conversion_rules_023_1.MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_023() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_023.xml", { "Pos_050202_name_conversion_rules_023.xsd", "Pos_050202_name_conversion_rules_023_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_023(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xml new file mode 100644 index 0000000000000000000000000000000000000000..943f24562bf67c19e3a67d402114cf48af066ee9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3277fbc528038fbff2b81634766d58822f3943b3 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c434d3693e5f585874a8763cc76d5eb389635607 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_023/Pos_050202_name_conversion_rules_023_1.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30275315e1ac3463e84d2c08c0c8d90507559355 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Conversion of module names + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule a: Target namespace values used in XSD schema documents shall be ordered +// alphabetically, independently from the above components (after conversion they are +// merely used as TTCN-3 module names). The string value of the target namespace values +// shall be used, i.e. without un-escaping or removing trailing “/” SOLIDUS characters +// of the authority part or any other changes to the character string. + +// Rule e: +// "_" (LOW LINE) characters occurring at the beginning or at the end of the name shall +// be removed, except trailing "_" (LOW LINE) characters resulted from converting target +// namespace values (to be used as TTCN-3 module names); + +module Pos_050202_name_conversion_rules_024 { + + import from schema_Pos_050202_name_conversion_rules_024 language "XSD" all; + import from schema_Pos_050202_name_conversion_rules_024_ language "XSD" all; + + template schema_Pos_050202_name_conversion_rules_024_.Test m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_024() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_024.xml", { "Pos_050202_name_conversion_rules_024.xsd", "Pos_050202_name_conversion_rules_024_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_024(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xml new file mode 100644 index 0000000000000000000000000000000000000000..718c21ff9df383bc17c20c233f77a30340b7043c --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xsd new file mode 100644 index 0000000000000000000000000000000000000000..276e270963fb1870ebc41ba4c99e6c83207c6aef --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6603b3455231764f3d3695108483d1c371be5571 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_024/Pos_050202_name_conversion_rules_024_1.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7233a8debd793c6891a6ec3db3911d80c0fccd4 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:5.2.2, Resolving name conflict in module names (not ending with underline) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule a: If the name being generated is the name of a TTCN-3 module and the character +// string generated by items a) to e) above is identical to an another, previously +// generated TTCN-3 module name, then a postfix shall be appended to the character +// string: the postfix shall consist of a "_" (LOW LINE) followed by the canonical +// lexical representation (see W3C XML Schema Part 2 [9], clause 2.3.1) of an integer, +// unless the name already finishes with a "_" (LOW LINE) character, in which case the +// postfix is an integer only. This integer shall be the least positive integer such +// that the new name is different from all previously generated TTCN 3 modules names +// and clashing definition name. + +module Pos_050202_name_conversion_rules_025 { + + import from schema_Pos_050202_name_conversion_rules_025 language "XSD" all; + import from schema_Pos_050202_name_conversion_rules_025_1 language "XSD" all; + + template schema_Pos_050202_name_conversion_rules_025_1.Test m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050202_name_conversion_rules_025() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050202_name_conversion_rules_025.xml", { "Pos_050202_name_conversion_rules_025.xsd", "Pos_050202_name_conversion_rules_025_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050202_name_conversion_rules_025(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d0e2a968650dc5494c55c65d1bf2b96830416d7 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b37948d5bc6c76f2a96b6c578df76e1167477cc9 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e0981c1126707b9fbeb4bbecefbd0013079d0c9f --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050202_name_conversion_rules/Pos_050202_name_conversion_rules_025/Pos_050202_name_conversion_rules_025_1.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a9dc37b890290a480bea9c3a59375d1ac426142 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.3, Verify order of top-level schema components + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule b: +// Within each target namespace, top-level schema components shall be +// divided into four sets ordered as follows: +// 1) element declarations; +// 2) attribute declarations; +// 3) complex type definitions and simple type definitions; +// 4) model group definitions. + +module Pos_050203_order_of_the_mapping_001 { + + import from schema_Pos_050203_order_of_the_mapping_001 language "XSD" all; + + template Item m_msg := "test"; + template Item_1 m_test1 := 5; + template Item_2 m_test2 := 0.1; + template Item_3 m_test3 := { field1 := 0, field2 := 1 }; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050203_order_of_the_mapping_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050203_order_of_the_mapping_001.xml", { "Pos_050203_order_of_the_mapping_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050203_order_of_the_mapping_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c623aa07a82ed8db2412fe4ad22753c9e02f371a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xml @@ -0,0 +1,2 @@ + +test \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..859e0fef7e71a36ce41c00cac4157220ebc0a630 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_001/Pos_050203_order_of_the_mapping_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45499ba9471de967d6874bc58579d2b53c65012e --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.3, Verify that alphabetical sorting is based on character ordinal numbers + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule c: +// Within each set of item b), schema components shall be ordered by name in +// ascending alphabetical order. +// +// Alphabetical order is defined as follows (3.1): way of sorting the XSD +// names based on the code positions of their characters according to +// ISO/IEC 10646 [i.9] +// +// Note: in UCA alphabetical sorting, the order of elements would be different: +// Ä, ä, Ö +module Pos_050203_order_of_the_mapping_002 { + + import from schema_Pos_050203_order_of_the_mapping_002 language "XSD" all; + + template Type m_msg := 1; + template Type_1 m_test1 := 0.1; + template Type_2 m_test2 := "test"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050203_order_of_the_mapping_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050203_order_of_the_mapping_002.xml", { "Pos_050203_order_of_the_mapping_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050203_order_of_the_mapping_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..7708e59129fdd20fea26c71f2f2f124fb0386714 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1a42f7448cd727b42063e8826f370604564ffc8a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_002/Pos_050203_order_of_the_mapping_002.xsd @@ -0,0 +1,8 @@ + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8d9e0da11a7b8c8f57d94825a15282aa342a710 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5.2.3, Verify that alphabetical sorting is done only inside sets of items + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Rule c: +// Within each set of item b), schema components shall be ordered by name in +// ascending alphabetical order. +// +// Alphabetical order is defined as follows (3.1): way of sorting the XSD +// names based on the code positions of their characters according to +// ISO/IEC 10646 [i.9] +module Pos_050203_order_of_the_mapping_003 { + + import from schema_Pos_050203_order_of_the_mapping_003 language "XSD" all; + + template Item m_msg := 3; + template Item_1 m_item1 := "test"; + template Item_2 m_item2 := 0.1; + template Item_3 m_item3 := true; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050203_order_of_the_mapping_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050203_order_of_the_mapping_003.xml", { "Pos_050203_order_of_the_mapping_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050203_order_of_the_mapping_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..c7ff26faae8d16fee2fd780c43c419f23ff9d247 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xml @@ -0,0 +1,2 @@ + +3 \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b3eccfcebcd5703cddd33725597c4130acce2eb6 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_003/Pos_050203_order_of_the_mapping_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3a4664d9833e3c0f5a23411d4e46c2adc227044a --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:5.2.3, Asure that namespaces are ordered lexically + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_050203_order_of_the_mapping_004 { + + import from schema_Pos_050203_order_of_the_mapping_004 language "XSD" all; + + template MyType m_msg := {f1 := {a:= 1}, f2 := {a:= 2}} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050203_order_of_the_mapping_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050203_order_of_the_mapping_004.xml", { "Pos_050203_order_of_the_mapping_004.xsd", "Pos_050203_order_of_the_mapping_004_1.xsd", "Pos_050203_order_of_the_mapping_004_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050203_order_of_the_mapping_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa86d9d9b651dd1c495f56e00bf43fad6a2d6490 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xml @@ -0,0 +1,10 @@ + + + + 1 + + + 2 + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..87dee208e665c5f1d12f91f859412297a8442838 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9e30e70f8cee11623234d22ecf88e682d54762a5 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_1.xsd @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_2.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1613783ddd978726295b1c878f84c059f03ad4de --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_004/Pos_050203_order_of_the_mapping_004_2.xsd @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.ttcn b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..07f2cf0716c8fabbc0d21adacdaa74316e323674 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:5.2.3, Asure that namespaces are ordered lexically + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_050203_order_of_the_mapping_005 { + + import from schema_Pos_050203_order_of_the_mapping_005 language "XSD" all; + + template MyType m_msg := {test1 := 1, test2 := 2}; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_050203_order_of_the_mapping_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_050203_order_of_the_mapping_005.xml", { "Pos_050203_order_of_the_mapping_005.xsd", "Pos_050203_order_of_the_mapping_005_1.xsd", "Pos_050203_order_of_the_mapping_005_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_050203_order_of_the_mapping_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xml b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..50ad3aec164cd2c63b151a9fa15d5918ea570864 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xml @@ -0,0 +1,8 @@ + + + 1 + 2 + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..203ec83fbde7826e79af957ad43c8f711de7c794 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_1.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..61d9baed483ee5fb2f9d58da54d9f89ba921f1dd --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_1.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_2.xsd b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8b78ecb7e33182365b019bbc6f064601e32760f3 --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/0502_name_conversion/050203_order_of_the_mapping/Pos_050203_order_of_the_mapping_005/Pos_050203_order_of_the_mapping_005_2.xsd @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.ttcn b/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..447ffb01e5b1d2a4e4170689a38748a2c7ef564b --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.ttcn @@ -0,0 +1,51 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:5, Verify that error is generated for missing XSD language tag in import clause + ** @verdict pass reject +***************************************************/ + +// The following requirements are tested: +// When importing from an XSD Schema, the following language identifier string shall be used: "XSD" + +module Neg_05_top_level_001 { + + import from schema_Neg_05_top_level_001 all; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_05_top_level_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_05_top_level_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.xsd b/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..648c8ee6632276f79aa767398573671037b8f13f --- /dev/null +++ b/ATS/xml/05_mapping_xml_schemas/05_top_level/Neg_05_top_level_001/Neg_05_top_level_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a18e6b6219831114b4afed9e1308cde0f49d484f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.1, Verify that a length-restricted XSD type shall be mapped to a corresponding length restricted TTCN 3 type. + ** @verdict pass reject + ***************************************************/ +module Neg_060101_length_001 { + + import from schema_Neg_060101_length_001 language "XSD" all; + + template E1 m_msg := {"A","B","C","D"}; //length is 3 + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060101_length_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060101_length_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..028ec2f4b3e670a08601f00e019cfe64492c33d8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Neg_060101_length_001/Neg_060101_length_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..255ad179739e0f40af8a0215fb8cb450688a8a14 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.1, Verify that a length-restricted XSD type shall be mapped to a corresponding length restricted TTCN 3 type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060101_length_001 { + + import from schema_Pos_060101_length_001 language "XSD" all; + + template E1 m_msg := "length_010"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060101_length_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060101_length_001.xml", { "Pos_060101_length_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060101_length_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..605419772611bcddcdbfa6c5748cff60fd04c45f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xml @@ -0,0 +1,4 @@ + +length_010 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b4f74c41dfece9458e470951716ec1254ae63ad7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_001/Pos_060101_length_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74b18169fa387e41c61829205828b1a1d597f6e7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.1, Verify that a length-restricted XSD type shall be mapped to a corresponding length restricted TTCN 3 type. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060101_length_002 { + + import from schema_Pos_060101_length_002 language "XSD" all; + + template E1 m_msg := {"A","B","C"}; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060101_length_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060101_length_002.xml", { "Pos_060101_length_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060101_length_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1f8b6f10a34a1729adc2089f01e7b8041366360 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xml @@ -0,0 +1,4 @@ + +A B C diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6dacadda63844ec9bcb15d1a70c0a66f4777c9c1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060101_length/Pos_060101_length_002/Pos_060101_length_002.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8e48cb4bc301637e99d4a8e5e0cdda6c42ee9b3f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.2, Verify that correct constraint is generated for the minLength facet + ** @verdict pass reject + ***************************************************/ +module Neg_060102_minlength_001 { + + import from schema_Neg_060102_minlength_001 language "XSD" all; + + template Test m_msg := "a"; // minLength is 3 -> the string "a" shall be rejected + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060102_minlength_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060102_minlength_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ba671af963e84e54b0cd71ec58546cab4a9c2c3a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Neg_060102_minlength_001/Neg_060102_minlength_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9976ade74a746872ed7d3a4bd3849f6cbdb38810 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.2, Verify mapping of the minLength facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060102_minlength_001 { + + import from schema_Pos_060102_minlength_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060102_minlength_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060102_minlength_001.xml", { "Pos_060102_minlength_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060102_minlength_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..874004ce3ad18b3ea8d0c4c57c80d4d5daab7e8c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4e4ecd0e419e7fffc9706dcc03c53fe5f645fbef --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060102_minlength/Pos_060102_minlength_001/Pos_060102_minlength_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aeff5f5dd82cba548f52cb3c67dbfe0970306baf --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.3, Verify that correct constraint is generated for the maxLength facet + ** @verdict pass reject + ***************************************************/ +module Neg_060103_maxlength_001 { + + import from schema_Neg_060103_maxlength_001 language "XSD" all; + + template Test m_msg := "abcd"; // maxLength is 3 -> the string "abcd" shall be rejected + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060103_maxlength_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060103_maxlength_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1ac798745c487b13c342c623e99e4033bee5ca4f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Neg_060103_maxlength_001/Neg_060103_maxlength_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43df849839fe7feb54db2eaed088196ba6104574 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.3, Verify mapping of the maxLength facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060103_maxlength_001 { + + import from schema_Pos_060103_maxlength_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060103_maxlength_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060103_maxlength_001.xml", { "Pos_060103_maxlength_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060103_maxlength_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..4d5224875506f01245523b6f842bf073c414cc7c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1425d82f49d77f4fd87f06e7a151f606a6c8693b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060103_maxlength/Pos_060103_maxlength_001/Pos_060103_maxlength_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c96d54c6ab2a14691f0f172282afb59e3cd47db --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.4, Verify that correct constraint is generated for the pattern facet + ** @verdict pass reject + ***************************************************/ +module Neg_060104_pattern_001 { + + import from schema_Neg_060104_pattern_001 language "XSD" all; + + template Test m_msg := "aUser@iNstitute"; // should fail as the pattern doesn't allow capital N + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060104_pattern_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060104_pattern_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b7d68bb1165b3a70b4cab73fa5d08036204c9835 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Neg_060104_pattern_001/Neg_060104_pattern_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fdbb16609452b1dca3d8547627a3539570ed9a2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.4, Verify mapping of the pattern facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060104_pattern_001 { + + import from schema_Pos_060104_pattern_001 language "XSD" all; + + template Test m_msg := "anotherUser@Institute"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060104_pattern_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060104_pattern_001.xml", { "Pos_060104_pattern_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060104_pattern_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..89c27af88a57bac9e1c16c4bd1b516bf0c6cb15f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xml @@ -0,0 +1,3 @@ + +anotherUser@Institute diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..dabd509a7b3dbbc348c9072103daff329f4e093f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060104_pattern/Pos_060104_pattern_001/Pos_060104_pattern_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53414ebcb678b970db20eb4fc0eab508e224d079 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify if tool rejects validation in case of restricted value due xsd type declaration. + ** @verdict pass reject + ***************************************************/ +module Neg_060105_enumeration_001 { + + import from schema_Neg_060105_enumeration_001 language "XSD" all; + + template E1 m_msg :=5; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060105_enumeration_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060105_enumeration_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0c294b9e7d9dcb681f890c3e759fc14475ece5b3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_001/Neg_060105_enumeration_001.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2b72ecc139ec27eb5ab95909ba93ea910b92da1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify if tool rejects validation in case of restricted enumerated value length due xsd type declaration. + ** @verdict pass reject + ***************************************************/ +module Neg_060105_enumeration_002 { + + import from schema_Neg_060105_enumeration_002 language "XSD" all; + + template E1 m_msg := black; // only enumeration elements with 2 to 4 chars are allowed + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060105_enumeration_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060105_enumeration_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7e9096fab51472736ca54b70508a841d57693546 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_002/Neg_060105_enumeration_002.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bcc399d78a54b6101893f856f9ba60074fb2285e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify if tool rejects validation in case of restricted value due xsd type declaration. + ** @verdict pass reject + ***************************************************/ +module Neg_060105_enumeration_003 { + + import from schema_Neg_060105_enumeration_003 language "XSD" all; + + template E1 m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060105_enumeration_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060105_enumeration_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..eaa5ab4cd72ac243e50265c390ba9c010d3e0f50 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_003/Neg_060105_enumeration_003.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fcaf904a459a5af2fb1cf1e0aaf86410f2334a7d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, disallow enumeration values removed by restriction + ** @verdict pass reject + ***************************************************/ +module Neg_060105_enumeration_004 { + + import from schema_Neg_060105_enumeration_004 language "XSD" all; + + template C2 m_msg := uNKNOWN; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060105_enumeration_004() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060105_enumeration_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..837f8bb7c03c38ae3a620481767a349cb8f404a6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xml @@ -0,0 +1,2 @@ + +UNKNOWN diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3f5efe3ef9f0ef12d853c7d9577fbbd4477c7f57 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Neg_060105_enumeration_004/Neg_060105_enumeration_004.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68731ca6cc06e3484ba3fa992c934cfe017792e1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify mapping of simple type definition that is a restriction of + ** string type with an enumeration facet. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_001 { + + import from schema_Pos_060105_enumeration_001 language "XSD" all; + + template E1 m_msg := on_; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_001.xml", { "Pos_060105_enumeration_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..382b3d97dc53d36f2d4d91a942d5511adc7996ba --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xml @@ -0,0 +1,4 @@ + +on diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..17c7def095ec217d41006857b5f571bb33dae201 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_001/Pos_060105_enumeration_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a7724de13d26c8ab0e5c46ed71abb27995097e2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify mapping of simple type definition that is a restriction of + ** integer type with an enumeration facet. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_002 { + + import from schema_Pos_060105_enumeration_002 language "XSD" all; + + template E1 m_msg := int_5; + + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_002.xml", { "Pos_060105_enumeration_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..00f08c1e13e48fd02a478e71a94bce56f2fcd2c7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xml @@ -0,0 +1,4 @@ + +-5 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1e1690db429ed5d5e80eaec4abaa412604be0e5d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_002/Pos_060105_enumeration_002.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5774ff8742b588f8ade77bb11510d4076eece511 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify mapping of simple type definition that is a restriction of + ** integer type with a minInclusive and a maxInclusive facet. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_003 { + + import from schema_Pos_060105_enumeration_003 language "XSD" all; + + template E1 m_msg :=5; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_003.xml", { "Pos_060105_enumeration_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..cc5499e0e68f8241b7cc157afe9c2a97e65a9147 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xml @@ -0,0 +1,4 @@ + +5 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6343c9a0d4a1bb986748af7a604084c532260a1b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_003/Pos_060105_enumeration_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5bd2ade5b6391d356cfb7cee333d64d108794580 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify mapping of simple type definition that is a restriction of + ** another simple type definition, derived by restriction from integer type with + ** the addition of a minInclusive and a maxInclusive facet. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_004 { + + import from schema_Pos_060105_enumeration_004 language "XSD" all; + + template E1 m_msg := 6; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_004.xml", { "Pos_060105_enumeration_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..09f2b8714e338a98ad6fb4c7723d2874cbdaa90c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xml @@ -0,0 +1,4 @@ + +6 \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d3305c1a3d849743a1b5eb1f6189c215f761b348 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_004/Pos_060105_enumeration_004.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eab53a3429ca018b68083a4fc5c832d8fc6050b7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, Verify mapping of simple type definition that is a restriction of another + ** simple type definition, derived by restriction from string with the addition of an + ** enumeration facet. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_005 { + + import from schema_Pos_060105_enumeration_005 language "XSD" all; + + template E1 m_msg := red; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_005.xml", { "Pos_060105_enumeration_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..677ffafc5362aa2dec4a8cee65a751cfc577fe85 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xml @@ -0,0 +1,4 @@ + +red diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bb03e0ebf2f313bb79c90b37d84f99e5bdb4c980 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_005/Pos_060105_enumeration_005.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15e610b3f5b6c42f0e841c12a503ec3f1e32e6b6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.5, TODO write purpose + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060105_enumeration_006 { + + import from schema_Pos_060105_enumeration_006 language "XSD" all; + + template C2 m_msg := b2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060105_enumeration_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060105_enumeration_006.xml", { "Pos_060105_enumeration_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060105_enumeration_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..4a0f2bc7ccf766eb596662c5423129481f642772 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xml @@ -0,0 +1,2 @@ + +B2 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c14780397922bde729c6fea920821394af7013b5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060105_enumeration/Pos_060105_enumeration_006/Pos_060105_enumeration_006.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..784207c326a5566916f9988d8151229fcc11eed5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.6, Verify mapping of the whiteSpace facet (preserve option) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060106_whitespace_001 { + + import from schema_Pos_060106_whitespace_001 language "XSD" all; + + template Test m_msg := " abc" & char(0,0,0,13) & char(0,0,0,10); + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060106_whitespace_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060106_whitespace_001.xml", { "Pos_060106_whitespace_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060106_whitespace_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b42fdb2719de8765292c26f5fb8cfccefd5ec6c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xml @@ -0,0 +1,3 @@ + + abc + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5dce05d05386a540ac7ef6f281b8d0acc820e731 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_001/Pos_060106_whitespace_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..23494c3911d83f2345588450d7c8922f882bce35 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.6, Verify mapping of the whiteSpace facet (replace option) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060106_whitespace_002 { + + import from schema_Pos_060106_whitespace_002 language "XSD" all; + + template Test m_msg := " abc" & char(0,0,0,9) & " def" & char(0,0,0,13) & char(0,0,0,10); + template Test m_rcv := " abc def "; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060106_whitespace_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060106_whitespace_002.xml", { "Pos_060106_whitespace_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rcv) { // The value has been changed by the encoder or decoder (in a predictable way) + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060106_whitespace_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..55ed699595884d27ead3eaf57d63b918f228c316 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xml @@ -0,0 +1,3 @@ + + abc def + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..eb30d146e92a0cd3b792166c11b629962ab39640 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_002/Pos_060106_whitespace_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b958fa2d8a6150fee6b891736141cb9a1f74a327 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.1.6, Verify mapping of the whiteSpace facet (collapse option) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060106_whitespace_003 { + + import from schema_Pos_060106_whitespace_003 language "XSD" all; + + template Test m_msg := " abc" & char(0,0,0,9) & " def" & char(0,0,0,13) & char(0,0,0,10); + template Test m_rcv := "abc def"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060106_whitespace_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060106_whitespace_003.xml", { "Pos_060106_whitespace_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rcv) { // The value has been changed by the encoder or decoder (in a predictable way) + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060106_whitespace_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..99e0c51ae76da4b39eefdd84ea4b9b701cc315f7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xml @@ -0,0 +1,3 @@ + + abc def + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c1a8641762b6deb888c7e56158ab727eb46e5dc8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060106_whitespace/Pos_060106_whitespace_003/Pos_060106_whitespace_003.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25573a7849754276ad1aee1710d9d369ca956d0c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.7, Verify mapping of an integer element with a minInclusive facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060107_mininclusive_001 { + + import from schema_Pos_060107_mininclusive_001 language "XSD" all; + + template E1 m_msg := -5; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060107_mininclusive_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060107_mininclusive_001.xml", { "Pos_060107_mininclusive_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060107_mininclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a908c69fb76391c2ec203d4564c9d7dc95951ab --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xml @@ -0,0 +1,4 @@ + +-5 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d9227843e8df70bfd8425410a5010a57cc13e6ef --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_001/Pos_060107_mininclusive_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3bf63f2de464fcc629b393f5ef583a17a24e77a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.7, Verify mapping of a float element with a numeric minInclusive value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060107_mininclusive_002 { + + import from schema_Pos_060107_mininclusive_002 language "XSD" all; + + template E1 m_msg := -5.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060107_mininclusive_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060107_mininclusive_002.xml", { "Pos_060107_mininclusive_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060107_mininclusive_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdf6e497022be3cab5ca94b00b916c1a23f188aa --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xml @@ -0,0 +1,4 @@ + +-5.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e669ef280bb273291035000e86f7a644a757a7e4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_002/Pos_060107_mininclusive_002.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..189c076fd2ba0fe194fae4e2df7194996a710f1f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.7, Verify mapping of a float element with special minInclusive values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060107_mininclusive_003 { + + import from schema_Pos_060107_mininclusive_003 language "XSD" all; + + template E1 m_msg := -5.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060107_mininclusive_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060107_mininclusive_003.xml", { "Pos_060107_mininclusive_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060107_mininclusive_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e6aa7c74e2f7807ffe7c6ada7ead32a54406449 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xml @@ -0,0 +1,4 @@ + +-5.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..00e42dff11e93079cbbc3846a4c72648301fca82 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_003/Pos_060107_mininclusive_003.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ba9149eb9a82326203d87cc8821ce68fc8eb0b8b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.7, Verify mapping of a float element with special minInclusive values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060107_mininclusive_004 { + + import from schema_Pos_060107_mininclusive_004 language "XSD" all; + + template E1 m_msg := infinity; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060107_mininclusive_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060107_mininclusive_004.xml", { "Pos_060107_mininclusive_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060107_mininclusive_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..c39e8d458388df51d895f9f76f1f7caaea7cf8bd --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xml @@ -0,0 +1,4 @@ + +INF diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c03f6a6628b322108719cbb7a1e1ed4e005ced82 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_004/Pos_060107_mininclusive_004.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4200c273facbbcf97553cc45086e5383d2dcd5c5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.7, Verify mapping of a float element with special minInclusive values + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060107_mininclusive_005 { + + import from schema_Pos_060107_mininclusive_005 language "XSD" all; + + template E1 m_msg := not_a_number; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060107_mininclusive_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060107_mininclusive_005.xml", { "Pos_060107_mininclusive_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060107_mininclusive_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..debd861f6c2a1d2a7a1a25cfade22710915d18bf --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xml @@ -0,0 +1,4 @@ + +NaN diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5575d19aae203aa757741134bda22da12f9e3fbe --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060107_mininclusive/Pos_060107_mininclusive_005/Pos_060107_mininclusive_005.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd5e7d5274095058e82316fb964ce66afc93b45f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.8, Verify mapping of elements of type integer with maxInclusive facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060108_maxinclusive_001 { + + import from schema_Pos_060108_maxinclusive_001 language "XSD" all; + + template E1 m_msg := 100; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060108_maxinclusive_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060108_maxinclusive_001.xml", { "Pos_060108_maxinclusive_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060108_maxinclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..542a3eb2551008b88aa902251e7a0a7e9117694b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xml @@ -0,0 +1,4 @@ + +100 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f12417892752ae6c001bf878639a51e1d6658097 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_001/Pos_060108_maxinclusive_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10ca329c0bd74cf7c5c31fdc33630f9f1e17a40a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.8, Verify mapping of a float type with a numeric maxInclusive facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060108_maxinclusive_002 { +//Float possible values from http://www.w3.org/TR/xmlschema-2/#float for xsd file : -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF are all legal literals for float + import from schema_Pos_060108_maxinclusive_002 language "XSD" all; + + template E1 m_msg := -5.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060108_maxinclusive_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060108_maxinclusive_002.xml", { "Pos_060108_maxinclusive_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060108_maxinclusive_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ef36f10525db3cda34a5b5a74e5d18bde2edc5e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xml @@ -0,0 +1,4 @@ + +-5.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2d042a7676a0d42102bfea04c27a5b1b573c5274 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_002/Pos_060108_maxinclusive_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0290be46e3f97da99b2b6b935e4265fe5482d5f5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.8, Verify mapping of a float type with a numeric maxInclusive facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060108_maxinclusive_003 { + + import from schema_Pos_060108_maxinclusive_003 language "XSD" all; + + template E1 m_msg := 5.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060108_maxinclusive_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060108_maxinclusive_003.xml", { "Pos_060108_maxinclusive_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060108_maxinclusive_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b1080b01d0f8da0833bff0b3b02114753edd70c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xml @@ -0,0 +1,4 @@ + +5.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..15b4b66e18715de3d558ffd1d0d7a37d58f6d912 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_003/Pos_060108_maxinclusive_003.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a14f64f4a391ca335e93629f93f266e76fb7eb44 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.8, Verify mapping of a float type with a numeric maxInclusive facet + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060108_maxinclusive_004 { + + import from schema_Pos_060108_maxinclusive_004 language "XSD" all; + + template E1 m_msg := not_a_number; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060108_maxinclusive_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060108_maxinclusive_004.xml", { "Pos_060108_maxinclusive_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060108_maxinclusive_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..47e0a76fdaec24564415735a0318fe995f22a883 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xml @@ -0,0 +1,4 @@ + +NaN diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2d61407fa5b83955051963b053e9323cff79fb8f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060108_maxinclusive/Pos_060108_maxinclusive_004/Pos_060108_maxinclusive_004.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4fbfce67715744d5fbfaaec28a98bfd310a869a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.9, Verify if tool rejects validation in case of restricted value due xsd type declaration. + ** @verdict pass reject + ***************************************************/ +module Neg_060109_minexclusive_001 { + + import from schema_Neg_060109_minexclusive_001 language "XSD" all; + + template E1 m_msg := 2; // valid values 6..10 + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060109_minexclusive_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060109_minexclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0ad2219b0541245981526076d19be0a0a03585f2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_001/Neg_060109_minexclusive_001.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f2ee8eee4eca4e743cf5412239bf285c3cd2962e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.9, Verify if tool rejects validation in case of restricted value due xsd type declaration. + ** @verdict pass reject + ***************************************************/ +module Neg_060109_minexclusive_002 { + + import from schema_Neg_060109_minexclusive_002 language "XSD" all; + + template E1 m_msg := 5; // valid values 6..10 + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060109_minexclusive_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060109_minexclusive_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..850b6ebcdb25055b24197c7fd88220d16a95f10d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Neg_060109_minexclusive_002/Neg_060109_minexclusive_002.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61751975f448c92ab9e9788403a68fae932a5168 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.9, Verify if tool accepts values restricted by xsd type declaration. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060109_minexclusive_001 { + + import from schema_Pos_060109_minexclusive_001 language "XSD" all; + + template E1 m_msg := 6; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060109_minexclusive_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060109_minexclusive_001.xml", { "Pos_060109_minexclusive_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060109_minexclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..31abf3df8fa42dfcb34950b68950b99e0d6a1caf --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xml @@ -0,0 +1,4 @@ + +6 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bb1ef478f3aed3e9964c83a0bd40c41ec43049f4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_001/Pos_060109_minexclusive_001.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa63125bd4034001dfdf0b1067ff510623363920 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.9, Verify if tool accepts values restricted by xsd type declaration. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060109_minexclusive_002 { + + import from schema_Pos_060109_minexclusive_002 language "XSD" all; + + template E1 m_msg := 7; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060109_minexclusive_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060109_minexclusive_002.xml", { "Pos_060109_minexclusive_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060109_minexclusive_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..63d10d37c47356f8aa5b045b81f44ddec0a4cd8d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xml @@ -0,0 +1,2 @@ + +7 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ff5c876299313936c6c6911bddd7db7b286ba6a0 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060109_minexclusive/Pos_060109_minexclusive_002/Pos_060109_minexclusive_002.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0192d09c948ed31b53b23386ad6eafe930c1d2d7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.ttcn @@ -0,0 +1,44 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.10, Verify that INF (negative infinity) or NaN (not-a-number), this type shall not be translated to TTCN-3 + ** @verdict pass reject + ***************************************************/ +module Neg_060110_maxexclusive_001 { + + import from schema_Neg_060110_maxexclusive_001 language "XSD" all; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060110_maxexclusive_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060110_maxexclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6a24cbd5642caaac013cae22e3d0dfc3659dd269 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Neg_060110_maxexclusive_001/Neg_060110_maxexclusive_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..963aff1b015572aeea749ed58c6c9eb1ce365793 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.10, Verify mapping of a maxExclusive facet applied to a type, which is derivative of integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060110_maxexclusive_001 { + + import from schema_Pos_060110_maxexclusive_001 language "XSD" all; + + template E1 m_msg := 99; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060110_maxexclusive_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060110_maxexclusive_001.xml", { "Pos_060110_maxexclusive_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060110_maxexclusive_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..e7bb3df3cadce50523c016b6b36311e0d1296414 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xml @@ -0,0 +1,4 @@ + +99 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c4b1b881cbd58af0e4b1f53bb17de23f7c979a1c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_001/Pos_060110_maxexclusive_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c38e5a4f4597d61e16dd714464fbf91129d404f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.10, Verify mapping of a maxExclusive facet applied to the float type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060110_maxexclusive_002 { + + import from schema_Pos_060110_maxexclusive_002 language "XSD" all; + + template E1 m_msg := -6.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060110_maxexclusive_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060110_maxexclusive_002.xml", { "Pos_060110_maxexclusive_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060110_maxexclusive_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..faed9a0e30ed2630685638c085991d2e35f68b3b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xml @@ -0,0 +1,4 @@ + +-6.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a0e553d0f3a401f7421562e317e9a1d687e102cd --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_002/Pos_060110_maxexclusive_002.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e21014478b2af1c73e409c22ae05a1c690383bbc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.1.10, Verify mapping of a maxExclusive facet applied to the float type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060110_maxexclusive_003 { + + import from schema_Pos_060110_maxexclusive_003 language "XSD" all; + + template E1 m_msg := -4.1; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060110_maxexclusive_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060110_maxexclusive_003.xml", { "Pos_060110_maxexclusive_003.xsd", "Pos_060110_maxexclusive_003_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060110_maxexclusive_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..1847ed8e18f1597276ae621575c36dea54873678 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xml @@ -0,0 +1,4 @@ + +-4.1 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4edc8ff2a4e243ad5f766881f3cdce7561dfc576 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003_1.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..be6262082103b3f1fca12d8429eac1d3187eb310 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060110_maxexclusive/Pos_060110_maxexclusive_003/Pos_060110_maxexclusive_003_1.xsd @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0c3bbd2ad3d6047ab1d8c2dd765a2bffd9f2a7f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass reject + ***************************************************/ +module Neg_060111_total_digits_001 { + + import from schema_Neg_060111_total_digits_001 language "XSD" all; + + template E1 m_msg := 0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060111_total_digits_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060111_total_digits_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7ae042aedbfdcbd55e1a34adcb2f7dd22bc633a1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_001/Neg_060111_total_digits_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a4dd272c9905da8f5214949c29bbc2f51476a461 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass reject + ***************************************************/ +module Neg_060111_total_digits_002 { + + import from schema_Neg_060111_total_digits_002 language "XSD" all; + + template E1 m_msg := -1000; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060111_total_digits_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060111_total_digits_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d13aa2085025f45480d2a3f64963ae9d3a3d932f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_002/Neg_060111_total_digits_002.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c963838e024bf0813867b8d58a06a4eff49b829 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass reject + ***************************************************/ +module Neg_060111_total_digits_003 { + + import from schema_Neg_060111_total_digits_003 language "XSD" all; + + template E1 m_msg := -100000.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060111_total_digits_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060111_total_digits_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..36edee24fe510b9d28bd49742e6795d5a887aee9 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_003/Neg_060111_total_digits_003.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dedde247626a33f5f370f5644a1c2760448616b7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass reject + ***************************************************/ +module Neg_060111_total_digits_004 { + + import from schema_Neg_060111_total_digits_004 language "XSD" all; + + template E1 m_msg := 999999.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060111_total_digits_004() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060111_total_digits_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c3a6d9eee06f8a40f865e2f7c6c695d199323515 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Neg_060111_total_digits_004/Neg_060111_total_digits_004.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f10204694efc4c4a3156a9ae414e74af447285f3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060111_total_digits_001 { + + import from schema_Pos_060111_total_digits_001 language "XSD" all; + + template E1 m_msg := -999; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060111_total_digits_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060111_total_digits_001.xml", { "Pos_060111_total_digits_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060111_total_digits_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c1ebfcdc76d4552b56ff00c9a165ac39bf0228de --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xml @@ -0,0 +1,2 @@ + +-999 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8bbf1486bb601cca32fb8cf22c0a41ec0e04c476 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_001/Pos_060111_total_digits_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e810272a870f5347440d13161ac2b7d012a5ebe --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060111_total_digits_002 { + + import from schema_Pos_060111_total_digits_002 language "XSD" all; + + template E1 m_msg := -1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060111_total_digits_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060111_total_digits_002.xml", { "Pos_060111_total_digits_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060111_total_digits_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f02727895821cb55b643d161313806829286196d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xml @@ -0,0 +1,2 @@ + +-1 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..618b2d54bf068f02b000555bc5f112898715ce3c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_002/Pos_060111_total_digits_002.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c174be15de813e36a521edeefff1b91411ed22cc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060111_total_digits_003 { + + import from schema_Pos_060111_total_digits_003 language "XSD" all; + + template E1 m_msg := 9999.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060111_total_digits_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060111_total_digits_003.xml", { "Pos_060111_total_digits_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060111_total_digits_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..9a5643575ab36309494ad67dcad977a4c0bc91a5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xml @@ -0,0 +1,2 @@ + +9999.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ce25f7141c50382e4822cb18d414ed810c46c270 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_003/Pos_060111_total_digits_003.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..03e1d3cb9a88c61668d0f4475ecf22a3bd94242b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060111_total_digits_004 { + + import from schema_Pos_060111_total_digits_004 language "XSD" all; + + template E1 m_msg := -9999.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060111_total_digits_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060111_total_digits_004.xml", { "Pos_060111_total_digits_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060111_total_digits_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..f9a758f26fe15d6de8f1fe67ef9e36494d19b834 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xml @@ -0,0 +1,2 @@ + +-9999.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..68c7e29cec382363ad45138a69f013d4b2462a83 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_004/Pos_060111_total_digits_004.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa7d7d86e40e8eed8a30047274d11b733a548d80 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.11, Check that totalDigits are converted to value boundaries + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060111_total_digits_005 { + + import from schema_Pos_060111_total_digits_005 language "XSD" all; + + template E1 m_msg := 0.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060111_total_digits_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060111_total_digits_005.xml", { "Pos_060111_total_digits_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060111_total_digits_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..9ecad680d15dcd96b7e927cbde62008feecf13fb --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xml @@ -0,0 +1,2 @@ + +0.0 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2e2a5a81f3c18f779bfb78cb1a54c8ddd845b024 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060111_total_digits/Pos_060111_total_digits_005/Pos_060111_total_digits_005.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce234cf76d8ee739641172ef6c97542106655514 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.12, Check that floats having same accuracy as fractionDigits are converted correct + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060112_fraction_digits_001 { + + import from schema_Pos_060112_fraction_digits_001 language "XSD" all; + + template ActualTemp m_msg := 99.9; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060112_fraction_digits_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060112_fraction_digits_001.xml", { "Pos_060112_fraction_digits_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060112_fraction_digits_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c82c9d5f313a6379a0c3d32bf26b2534bf7073e6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xml @@ -0,0 +1,2 @@ + +99.9 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c434c67d22ea30454ef9d627c3dd4deb1fbad3bb --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_001/Pos_060112_fraction_digits_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..77c5018406d658651513cfb742c0c744347acea9 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:6.1.12, Check that floats having higher accuracy than fractionDigits are converted correct + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060112_fraction_digits_002 { + + import from schema_Pos_060112_fraction_digits_002 language "XSD" all; + + template ActualTemp m_msg := 9.999E1; + template ActualTemp m_rcv := 99.9; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060112_fraction_digits_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060112_fraction_digits_002.xml", { "Pos_060112_fraction_digits_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rcv) { // The value has been changed by the encoder or decoder (in a predictable way) + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060112_fraction_digits_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ad201ba30e666ab4cc58bce1d4bf8a9808dfe40 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xml @@ -0,0 +1,2 @@ + +99.9 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2a6e7ae4a91bca80ea4765c6892d7749ec53433a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060112_fraction_digits/Pos_060112_fraction_digits_002/Pos_060112_fraction_digits_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.ttcn b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c22b3b6c0d133e929167b252a9d9f4116d2e8d8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 487 + ** @version 0.0.1 + ** @purpose 9:6.1.13, Handle not mapped facets to transparent + ** @verdict pass accept, ttcn3verdict:pass + **************◊*************************************/ +module Pos_060113_not_mapped_001 { + + import from schema_Pos_060113_not_mapped_001 language "XSD" all; + + template DecimalWithWhole m_msg := 1.3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060113_not_mapped_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060113_not_mapped_001.xml", { "Pos_060113_not_mapped_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060113_not_mapped_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xml b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..1954afdecac56a5ff8a266fdc0f5422b0cfbd194 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xml @@ -0,0 +1,2 @@ + +1.3 diff --git a/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xsd b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d396e7e9ea1990480a6ce4d13e2c10e12d7978c0 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0601_mapping_of_facets/060113_not_mapped/Pos_060113_not_mapped_001/Pos_060113_not_mapped_001.xsd @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e23aed078766eb888880f3abc2d7125d51e82ef7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.2.1, Verify mapping of a string type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060201_string_001 { + + import from schema_Pos_060201_string_001 language "XSD" all; + + template E1 m_msg := "string"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060201_string_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060201_string_001.xml", { "Pos_060201_string_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060201_string_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..e5db63fed90e6ecc4537373f08f3446b884db49c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xml @@ -0,0 +1,4 @@ + +string diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4de726b84cc69a344ce31b1b74798fe17699f0f1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060201_string/Pos_060201_string_001/Pos_060201_string_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6a0a9f04b1c21b3ee3e79ea7650671b2784974f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.2, Verify mapping of a normalizedString type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060202_normalized_string_001 { + + import from schema_Pos_060202_normalized_string_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060202_normalized_string_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060202_normalized_string_001.xml", { "Pos_060202_normalized_string_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060202_normalized_string_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..eee868e0271db9d469272514c13fc34b69b18646 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9d035d35c9b041e46c7ad50c8917b5c74d163fd4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060202_normalized_string/Pos_060202_normalized_string_001/Pos_060202_normalized_string_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..077099387318a83f2bba9bf5c38de26bb6497337 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.3, Verify mapping of a token type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060203_token_001 { + + import from schema_Pos_060203_token_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060203_token_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060203_token_001.xml", { "Pos_060203_token_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060203_token_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..1b1b0da6f22c3e8f1ce8a9a34d603ca10181da0d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..85c0392ed3d80465a7e989f5f4e0477abbabc74b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060203_token/Pos_060203_token_001/Pos_060203_token_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1dc7234f1ea4475c55e6505c5e0b91dd12e4dadc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.2.4, Verify mapping of a Name type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060204_name_001 { + + import from schema_Pos_060204_name_001 language "XSD" all; + + template E1 m_msg := "Name"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060204_name_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060204_name_001.xml", { "Pos_060204_name_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060204_name_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..71652e077dec71f7e448a80b7a341938807b6997 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xml @@ -0,0 +1,4 @@ + +Name diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..aead2f3dad7ca4692ce2bc6aed0d8a2fb03cb98d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060204_name/Pos_060204_name_001/Pos_060204_name_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5d1d64bfebe0b7bd7f433f69bc7ed2bd15dae317 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.5, Verify mapping of a NMTOKEN type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060205_nmtoken_001 { + + import from schema_Pos_060205_nmtoken_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060205_nmtoken_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060205_nmtoken_001.xml", { "Pos_060205_nmtoken_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060205_nmtoken_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..b39872773e8810da1c02dd3b5f515f36d135b30c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b95100d5d19f5d138b5c541b3bc0c5ce220f8813 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060205_nmtoken/Pos_060205_nmtoken_001/Pos_060205_nmtoken_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0980a470263644df609eeb2738cb1a59b93c314d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.6, Verify mapping of a NCName type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060206_ncname_001 { + + import from schema_Pos_060206_ncname_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060206_ncname_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060206_ncname_001.xml", { "Pos_060206_ncname_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060206_ncname_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d64d57c105b1bf01ab971bee663e5862572e8e59 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2537d333cd1bbc488435effd8790e18437b5c712 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060206_ncname/Pos_060206_ncname_001/Pos_060206_ncname_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9aafde039184309e138565f9aa451f9fd894b1e3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.7, Verify mapping of an ID type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060207_id_001 { + + import from schema_Pos_060207_id_001 language "XSD" all; + + template Test m_msg := "abc"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060207_id_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060207_id_001.xml", { "Pos_060207_id_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060207_id_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d3448a8b23708ee33fcdc5e74803432fa899dd3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xml @@ -0,0 +1,3 @@ + +abc diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e7685a8e28879235754b07df28725e86aa5443c1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060207_id/Pos_060207_id_001/Pos_060207_id_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28b40bf01876557c95e69db7eadf02b5123f0a64 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.8, Verify mapping of an IDREF type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060208_idref_001 { + + import from schema_Pos_060208_idref_001 language "XSD" all; + + template Test m_msg := { + item := "abc", + itemref := "abc" + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060208_idref_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060208_idref_001.xml", { "Pos_060208_idref_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060208_idref_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..5ac7d283bc5ce572030fa9a4543d847786a17154 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xml @@ -0,0 +1,6 @@ + + + abc + abc + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..86352bb05a8cc0c20cffd0f5c2c371e89d337ada --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060208_idref/Pos_060207_idref_001/Pos_060208_idref_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..54dfc2e7d16782d72836c7f7242174cb5d2d6ff6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.10, Verify mapping of the hexBinary type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060210_hexadecimal_binary_001 { + + import from schema_Pos_060210_hexadecimal_binary_001 language "XSD" all; + + template Test m_msg := '0123456789ABCDEF'O; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060210_hexadecimal_binary_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060210_hexadecimal_binary_001.xml", { "Pos_060210_hexadecimal_binary_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060210_hexadecimal_binary_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..139f9b89e1b4ddd9cc4905a0df42ed7a8f9f25bd --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xml @@ -0,0 +1,3 @@ + +0123456789ABCDEF diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1cb281f220ccfe273c6bcc55911383699746b5a7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060210_hexadecimal_binary/Pos_060210_hexadecimal_binary_001/Pos_060210_hexadecimal_binary_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c50a68aeeecd0065cc13ab885c722f728f84dae --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.11, Verify mapping of the base64Binary type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060211_base_64_binary_001 { + + import from schema_Pos_060211_base_64_binary_001 language "XSD" all; + + template Test m_msg := '4A6F686E20536D697468'O; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060211_base_64_binary_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060211_base_64_binary_001.xml", { "Pos_060211_base_64_binary_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060211_base_64_binary_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6488705024949bdd11116f80b28b107264ef5ca --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xml @@ -0,0 +1,3 @@ + +Sm9obiBTbWl0aA== diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9b53aa41660460e6cd3d1a94fa105a9a9c1f7df7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060211_base_64_binary/Pos_060211_base_64_binary_001/Pos_060211_base_64_binary_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0dc004309d7867f493319e97d5e84c438892f7dc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.12, Verify mapping of an anyURI type + ** @verdict pass reject + ***************************************************/ +module Neg_060212_any_uri_001 { + + import from schema_Neg_060212_any_uri_001 language "XSD" all; + + template E1 m_msg := "http://etsi.org" & char(0,0,0,13) & char(0,0,0,10) & char (0,0,0,9);//String with no CRLFHT + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060212_any_uri_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060212_any_uri_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..148a0739804c654dc7fe6f43224167a6b7e2e023 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_001/Neg_060212_any_uri_001.xsd @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a883c6acd9781982a3a4ec8361fb8b0c4118232 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.2.12, Verify mapping of an anyURI type + ** @verdict pass reject + ***************************************************/ +module Neg_060212_any_uri_002 { + + import from schema_Neg_060212_any_uri_002 language "XSD" all; + + template E1 m_msg := "http://etsi.org ";//String with no HT - Horizontal TAB + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060212_any_uri_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060212_any_uri_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..86bedd75fb0db3ac098487e0ce1cb000f8412390 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Neg_060212_any_uri_002/Neg_060212_any_uri_002.xsd @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fedd3f37b7c5e3b2be9356362f3efde95c1d725 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.2.12, Verify mapping of an anyURI type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060212_any_uri_001 { + + import from schema_Pos_060212_any_uri_001 language "XSD" all; + + template E1 m_msg := "http://etsi.org"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060212_any_uri_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060212_any_uri_001.xml", { "Pos_060212_any_uri_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060212_any_uri_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0f1e3322776f11914e8f22c9a1fac28f46607b03 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xml @@ -0,0 +1,4 @@ + +http://etsi.org diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8cfda37324b0396ad7869d896f8f8c4efd95bd43 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060212_any_uri/Pos_060212_any_uri_001/Pos_060212_any_uri_001.xsd @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.ttcn b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6e30648d08c8239499e4928bb8978d9de2f25b69 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.13, Verify mapping of the language type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060213_language_001 { + + import from schema_Pos_060213_language_001 language "XSD" all; + + template Test m_msg := "en-GB"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060213_language_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060213_language_001.xml", { "Pos_060213_language_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060213_language_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xml b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d76d23ad11fe9bc0680b320f1ce8203a76622080 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xml @@ -0,0 +1,3 @@ + +en-GB diff --git a/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xsd b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3a22b71f8e067d22ddf30a1e1a32a7bbd3bc484d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0602_string_types/060213_language/Pos_060213_language_001/Pos_060213_language_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3425bcd806b8452525cbdf64d9dd48f2acde166a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.1, Verify that the integer type shall be translated to TTCN-3 as a plain integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060301_integer_001 { + + import from schema_Pos_060301_integer_001 language "XSD" all; + + template E1 m_msg := 2147483647; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060301_integer_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060301_integer_001.xml", { "Pos_060301_integer_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060301_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..46ec61745085e3aa5b47bab937ec8810be64932d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xml @@ -0,0 +1,4 @@ + +2147483647 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..610494f22fb3bda1eeca4a43c2a6f323da2f618b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060301_integer/Pos_060301_integer_001/Pos_060301_integer_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef5bb32988c564f7fc154e5ef54dea600cf085e7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.2, Verify that the integer type shall be translated to TTCN-3 as the range-restricted integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060302_positive_integer_001 { + + import from schema_Pos_060302_positive_integer_001 language "XSD" all; + + template E1 m_msg := 2147483647; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060302_positive_integer_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060302_positive_integer_001.xml", { "Pos_060302_positive_integer_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060302_positive_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..3e369e84bfb6c6e90f27f77137aca5aae5b91437 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xml @@ -0,0 +1,4 @@ + +2147483647 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7a621038de3ecd18f4d94e298f15bf3c9c885567 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060302_positive_integer/Pos_060302_positive_integer_001/Pos_060302_positive_integer_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30bd4a24c7a0df13b940d7643548855d63d79936 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.3, Verify that the non positive integer type shall be translated to TTCN-3 as the range-restricted integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060303_non_positive_integer_001 { + + import from schema_Pos_060303_non_positive_integer_001 language "XSD" all; + + template E1 m_msg := -2147483648; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060303_non_positive_integer_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060303_non_positive_integer_001.xml", { "Pos_060303_non_positive_integer_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060303_non_positive_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..75cc85970feba714babc6aff7effde3393f71470 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xml @@ -0,0 +1,4 @@ + +-2147483648 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d2d13adc4c4aea5eb17950e50ecca893126fcfc6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060303_non_positive_integer/Pos_060303_non_positive_integer_001/Pos_060303_non_positive_integer_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28ecf28e2671ef50f10900aa501a2d52398e3568 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.4, Verify that the negative integer type shall be translated to TTCN-3 as the range-restricted integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060304_negative_integer_001 { + + import from schema_Pos_060304_negative_integer_001 language "XSD" all; + + template E1 m_msg := -1; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060304_negative_integer_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060304_negative_integer_001.xml", { "Pos_060304_negative_integer_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060304_negative_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..1101831ff6c9b6418fd51476fa49121d9f00d890 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xml @@ -0,0 +1,4 @@ + +-1 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..48c8755522fdf5ebf65a7d84d40e70fec0e84f89 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060304_negative_integer/Pos_060304_negative_integer_001/Pos_060304_negative_integer_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce7fde310ebb41f88e9d2744b0962995832090ea --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.5, Verify that the non negative integer type shall be translated to TTCN-3 as the range-restricted integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060305_non_negative_integer_001 { + + import from schema_Pos_060305_non_negative_integer_001 language "XSD" all; + + template E1 m_msg := 0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060305_non_negative_integer_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060305_non_negative_integer_001.xml", { "Pos_060305_non_negative_integer_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060305_non_negative_integer_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d94995050e067a49333c8c5be0b4442bb95cb388 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xml @@ -0,0 +1,4 @@ + +0 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..dd66dd27d978ae3db1f17c5218014a738d1f2f8f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060305_non_negative_integer/Pos_060305_non_negative_integer_001/Pos_060305_non_negative_integer_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c7e0744f473ce1d254de6466ffbd78b9229347f4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.6, Verify that long type (64bit) shall be translated to TTCN-3 as a plain long long + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060306_long_001 { + + import from schema_Pos_060306_long_001 language "XSD" all; + + template E1 m_msg := 9223372036854775807; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060306_long_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060306_long_001.xml", { "Pos_060306_long_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060306_long_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..f332aebba49be70b55df1e54275b0d2b4f4e5280 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xml @@ -0,0 +1,4 @@ + +9223372036854775807 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..51aaf45f7e05b00d9927c7a23c4239244341953e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060306_long/Pos_060306_long_001/Pos_060306_long_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e41d7d29afb4c4bf73539caeb08a8197c02e1b98 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.7, Verify that unsigned long type (64bit) shall be translated to TTCN-3 as a plain unsigned long long + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060307_unsigned_long_001 { + + import from schema_Pos_060307_unsigned_long_001 language "XSD" all; + + template E1 m_msg := 18446744073709551615; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060307_unsigned_long_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060307_unsigned_long_001.xml", { "Pos_060307_unsigned_long_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060307_unsigned_long_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..41ab65ade60795ee5058a96fee43f278d51fc8b8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xml @@ -0,0 +1,4 @@ + +18446744073709551615 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6d806abe3814dc75c05275dce92f74aa85762acd --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060307_unsigned_long/Pos_060307_unsigned_long_001/Pos_060307_unsigned_long_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2551c390c689454561456864c4dadd71b411b106 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.8, Verify that int type (32bit) shall be translated to TTCN-3 as a plain long as defined in clause D.2.1.2 of ES 201 873 1 [1]) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060308_int_001 { + + import from schema_Pos_060308_int_001 language "XSD" all; + + template E1 m_msg := 2147483647; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060308_int_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060308_int_001.xml", { "Pos_060308_int_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060308_int_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..f975ae1f2ea493a5dc6222c43c8b2ac729744684 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xml @@ -0,0 +1,4 @@ + +2147483647 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4e6ad8dd928264605aeec62f30d753d98a7449a1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060308_int/Pos_060308_int_001/Pos_060308_int_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa82a225a57f60398b266540ec603dbe7804226c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.9, Verify that unsigned int type (32bit) shall be translated to TTCN-3 as a plain unsignedlong as defined in clause D.2.1.2 of ES 201 873 1 [1] + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060309_unsigned_int_001 { + + import from schema_Pos_060309_unsigned_int_001 language "XSD" all; + + template E1 m_msg := 4294967295; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060309_unsigned_int_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060309_unsigned_int_001.xml", { "Pos_060309_unsigned_int_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060309_unsigned_int_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..a58bdaa48b85222aeeb65233aaae9656b4ce6208 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xml @@ -0,0 +1,4 @@ + +4294967295 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..afaa1eed1c1d293bffe0c2ac202369d73b194be3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060309_unsigned_int/Pos_060309_unsigned_int_001/Pos_060309_unsigned_int_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30e509ab296a260a8aa1c6eec37674ba9f4460a2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.10, Verify that short type (16bit) shall be translated to TTCN-3 as a plain short as defined in clause D.2.1.1 of ES 201 873 1 [1] + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060310_short_001 { + + import from schema_Pos_060310_short_001 language "XSD" all; + + template E1 m_msg := 32767; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060310_short_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060310_short_001.xml", { "Pos_060310_short_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060310_short_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..af3c37d42dab5f8841b93c7da088ec330be3ba92 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xml @@ -0,0 +1,4 @@ + +32767 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..56d280d70d2e3a6d70b73fa9964dbb2a6a1e7075 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060310_short/Pos_060310_short_001/Pos_060310_short_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0992cdf6439652048b05dd31957113d73a51b541 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.11, Verify that unsigned short type (16bit) shall be translated to TTCN-3 as a plain unsigned short as defined in clause D.2.1.1 of ES 201 873 1 [1] + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060311_unsigned_short_001 { + + import from schema_Pos_060311_unsigned_short_001 language "XSD" all; + + template E1 m_msg := 65535; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060311_unsigned_short_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060311_unsigned_short_001.xml", { "Pos_060311_unsigned_short_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060311_unsigned_short_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..fcdedfb613e36264653439524096ea01aac46165 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xml @@ -0,0 +1,4 @@ + +65535 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7f62f2251581343e963db517541ce3ca75857d66 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060311_unsigned_short/Pos_060311_unsigned_short_001/Pos_060311_unsigned_short_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..28870f5441d40d27501b6199142af3bf21580dda --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.12, Verify that byte type (8bit) shall be translated to TTCN-3 as a plain byte as defined in clause D.2.1.0 of ES 201 873 1 [1] + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060312_byte_001 { + + import from schema_Pos_060312_byte_001 language "XSD" all; + + template E1 m_msg := 127; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060312_byte_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060312_byte_001.xml", { "Pos_060312_byte_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060312_byte_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8323d610be0b03117b0f30e177ee09b6bd9fc015 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xml @@ -0,0 +1,4 @@ + +127 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c19a7fdc2aa7cd0808cd5e41bf96a819a38d1745 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060312_byte/Pos_060312_byte_001/Pos_060312_byte_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.ttcn b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f05f544f4485c281ffe89e5f5cde2a8faa3e510a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.3.13, Verify that unsigned byte type (8bit) shall be translated to TTCN-3 as a plain unsigned byte as defined in clause D.2.1.0 of ES 201 873 1 [1] + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060313_unsigned_byte_001 { + + import from schema_Pos_060313_unsigned_byte_001 language "XSD" all; + + template E1 m_msg := 255; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060313_unsigned_byte_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060313_unsigned_byte_001.xml", { "Pos_060313_unsigned_byte_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060313_unsigned_byte_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xml b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ef35976b3f79476e03752b1de17a6d04ecea4fe --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xml @@ -0,0 +1,4 @@ + +255 diff --git a/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xsd b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b4f8bb39901c1d517edfc034e9322e783d6de3a1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0603_integer_types/060313_unsigned_byte/Pos_060313_unsigned_byte_001/Pos_060313_unsigned_byte_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.ttcn b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bd50de3ac886d3aabe8aae6227af46bc1e4fc72a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.4.1, Verify that decimal type shall be translated to TTCN-3 as a plain float + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060401_decimal_001 { + + import from schema_Pos_060401_decimal_001 language "XSD" all; + + template E1 m_msg := -5.0; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060401_decimal_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060401_decimal_001.xml", { "Pos_060401_decimal_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060401_decimal_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xml b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..739b1ccea6491a5b9bda980135d36a903a3ce1a2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xml @@ -0,0 +1,4 @@ + +-5.0 diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xsd b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b160f8a9afb67f2e96e3f8426ab3d95c7624a0b2 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060401_decimal/Pos_060401_decimal_001/Pos_060401_decimal_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.ttcn b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4315bdbc34673ab66cdd81316facc41dd9f8e490 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.4.2, Verify conversion of XSD float type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The float type shall be translated to TTCN-3 as an IEEE754float as defined in +// clause D.2.1.4 of ES 201 873-1 [1] + +module Pos_060402_float_001 { + + import from schema_Pos_060402_float_001 language "XSD" all; + + template MyType m_msg := 3.14; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060402_float_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060402_float_001.xml", { "Pos_060402_float_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060402_float_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xml b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..697a4c7924aafa08e97a44ec6ff8f68b9dfbcc5e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xml @@ -0,0 +1,2 @@ + +3.14 \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xsd b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a5f395490e5089235f0dec58a828a2155fc8110c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060402_float/Pos_060402_float_001/Pos_060402_float_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.ttcn b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..61944c9d96308f6ebf14982e550de6b1b26e09e3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.4.3, Verify that double type shall be translated to TTCN-3 as an IEEE754double as defined in clause D.2.1.4 of ES 201 873 1 [1]: + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060403_double_001 { + + import from schema_Pos_060403_double_001 language "XSD" all; + + template E1 m_msg := 1.23E9; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060403_double_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060403_double_001.xml", { "Pos_060403_double_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060403_double_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xml b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f1035ba4571e9103ea53890cadc620292c0c0fc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xml @@ -0,0 +1,4 @@ + +1.23E9 diff --git a/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xsd b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3f4408bcbcb6349814e137290498e770d7f9c213 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0604_float_types/060403_double/Pos_060403_double_001/Pos_060403_double_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2874cd3f5523af48f4e06ec8225cf990b0c6a2ce --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.5.1, Verify mapping of the duration type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060501_duration_001 { + + import from schema_Pos_060501_duration_001 language "XSD" all; + + template Test m_msg := "P5Y"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060501_duration_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060501_duration_001.xml", { "Pos_060501_duration_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060501_duration_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..84668196cf3aa57c4ff82402dd342666dbebdd76 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xml @@ -0,0 +1,3 @@ + +P5Y diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..38f9f6bb2f5136329c60bdeb19b2817e745e45a7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060501_duration/Pos_060501_duration_001/Pos_060501_duration_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d6f19206179e9d9a49a1fada872ddb37932dff31 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060502_date_and_time_001 { + + import from schema_Neg_060502_date_and_time_001 language "XSD" all; + + template E1 m_msg := "2014-04-17T13:59"; //invalid value + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060502_date_and_time_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060502_date_and_time_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..22ec9e823e6a4f25e73df63917ed17b86e313eda --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_001/Neg_060502_date_and_time_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..751cb25de1470e1f38cdea112b08a76448e91819 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060502_date_and_time_002 { + + import from schema_Neg_060502_date_and_time_002 language "XSD" all; + + template E1 m_msg := "2014-04-1713:59"; //invalid value + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060502_date_and_time_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060502_date_and_time_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..34e89d8c09855b2d97b10945834ab4c143cd9db4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_002/Neg_060502_date_and_time_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad3b2b0173a05a79d3899e2573080fed1b6a2552 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060502_date_and_time_003 { + + import from schema_Neg_060502_date_and_time_003 language "XSD" all; + + template E1 m_msg := "99-04-17T13:59"; //invalid value + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060502_date_and_time_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060502_date_and_time_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..88058aba112a02c8ef10b283ef0dbe2964224a90 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_003/Neg_060502_date_and_time_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..71e9e5d4f65ab6fd66c75c0c4616e89761ceeb84 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060502_date_and_time_004 { + + import from schema_Neg_060502_date_and_time_004 language "XSD" all; + + template E1 m_msg := "2014-04-17"; //invalid value + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060502_date_and_time_004() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060502_date_and_time_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1b761395a45c98530e64e7314f8765e9ea73cde1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Neg_060502_date_and_time_004/Neg_060502_date_and_time_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fa2896b91953aa3450c1b40ec57385336126b02 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060502_date_and_time_001 { + + import from schema_Pos_060502_date_and_time_001 language "XSD" all; + + template E1 m_msg := "2014-04-17T13:59:00"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060502_date_and_time_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060502_date_and_time_001.xml", { "Pos_060502_date_and_time_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060502_date_and_time_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e2edc672387df2e955dd74388ef408cb5081c05 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xml @@ -0,0 +1,4 @@ + +2014-04-17T13:59:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..eff546175262ea396271e69982d09a53ccff455a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_001/Pos_060502_date_and_time_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f7c95427de7676e65ffcbe1c63fc2f295a39234a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060502_date_and_time_002 { + + import from schema_Pos_060502_date_and_time_002 language "XSD" all; + + template E1 m_msg := "2014-04-17T13:59:00.5"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060502_date_and_time_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060502_date_and_time_002.xml", { "Pos_060502_date_and_time_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060502_date_and_time_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..175507d18a46b6ac97e70f21aea56c23eb868383 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xml @@ -0,0 +1,4 @@ + +2014-04-17T13:59:00.5 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4ee2991d1043ecfd6104a19c13a97393fc9225ab --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_002/Pos_060502_date_and_time_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c4a6089b72ccaff6bea89afb7e77f59d4da531d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060502_date_and_time_003 { + + import from schema_Pos_060502_date_and_time_003 language "XSD" all; + + template E1 m_msg := "2014-04-17T13:59:00+01:00"; //+01h = Central Europa + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060502_date_and_time_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060502_date_and_time_003.xml", { "Pos_060502_date_and_time_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060502_date_and_time_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..68c8f12ef501aca9b50e5a4c6429ffd1a23b00ca --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xml @@ -0,0 +1,4 @@ + +2014-04-17T13:59:00+01:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..221fb441647cc098e53624b29ff7d0bc312a21ac --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_003/Pos_060502_date_and_time_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7698487875702783ac68e29d7b15f9fabd9fa445 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.2, Verify that the dateTime type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060502_date_and_time_004 { + + import from schema_Pos_060502_date_and_time_004 language "XSD" all; + + template E1 m_msg := "2014-04-17T13:59:00Z";// Coordinated Universal Time (UTC) + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060502_date_and_time_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060502_date_and_time_004.xml", { "Pos_060502_date_and_time_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060502_date_and_time_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..759116dc951d952ef5882ab01d56b307dfe7af4b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xml @@ -0,0 +1,4 @@ + +2014-04-17T13:59:00Z diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..095fbbf0229f68a2c49704eb182eeeda87b21475 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060502_date_and_time/Pos_060502_date_and_time_004/Pos_060502_date_and_time_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b25db80a319d3964e75072b058072dc8475fc21e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.5.3, Verify mapping of the time type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060503_time_001 { + + import from schema_Pos_060503_time_001 language "XSD" all; + + template Test m_msg := "09:30:10.5"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060503_time_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060503_time_001.xml", { "Pos_060503_time_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060503_time_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f0ebb03d939ce0b7c4352b97ee7799e8bc4688b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xml @@ -0,0 +1,3 @@ + +09:30:10.5 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bea47182e8c96a2270514a7394fa3c72fde4c024 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060503_time/Pos_060503_time/Pos_060503_time_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21d1ac2c3a65befe71f6663c0d326dff615c580f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060504_date_001 { + + import from schema_Neg_060504_date_001 language "XSD" all; + + template E1 m_msg := "99-04-12"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060504_date_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060504_date_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5f71502a863169a1e166ebe12b45c1a84e19a344 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_001/Neg_060504_date_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19d9c2980769b52e66e9cce63ae244babafcd38c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060504_date_002 { + + import from schema_Neg_060504_date_002 language "XSD" all; + + template E1 m_msg := "2014-4-2"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060504_date_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060504_date_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e4fda32b74c0681ef0796eef264e2a178537e1d8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_002/Neg_060504_date_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7446127bc23106c0234d0907e0a106692f3d362 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060504_date_003 { + + import from schema_Neg_060504_date_003 language "XSD" all; + + template E1 m_msg := "2014/04/02"; //wrong format - slash not alowed + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060504_date_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060504_date_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8b9a66e63331a452fc0ee17b0a286f8f9479f05c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_003/Neg_060504_date_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ed2d443b2502ffa582541ff98147b2d7c04a2fd --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060504_date_004 { + + import from schema_Neg_060504_date_004 language "XSD" all; + + template E1 m_msg := "04-12-2014"; //wrong format must be 2014-04-12 + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060504_date_004() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060504_date_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3e8a7f94b9add846abfcedb936c5359cb26a51c7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Neg_060504_date_004/Neg_060504_date_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a25e7edb9f3994cc20822b1365edbdbfa26cf30c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060504_date_001 { + + import from schema_Pos_060504_date_001 language "XSD" all; + + template E1 m_msg := "2014-04-12"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060504_date_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060504_date_001.xml", { "Pos_060504_date_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060504_date_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..cc545245709b7daa70bcbdce87a6b003f62956c1 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xml @@ -0,0 +1,4 @@ + +2014-04-12 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ddddf8ed2add06a4992e206a742df7881ea8c621 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_001/Pos_060504_date_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..821c60c985bcb488a38981a6638d838c118d865a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060504_date_002 { + + import from schema_Pos_060504_date_002 language "XSD" all; + + template E1 m_msg := "12014-04-12"; //April 12, 12014 + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060504_date_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060504_date_002.xml", { "Pos_060504_date_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060504_date_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..af6813ecaa277ab5a0e77f3e614bf066e7abb15f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xml @@ -0,0 +1,4 @@ + +12014-04-12 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1401094f2c27f6f3024fbef71c7db22a27ccaba4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_002/Pos_060504_date_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24f4f00010b2c64a346cfb36ea53cd36c1735a92 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060504_date_003 { + + import from schema_Pos_060504_date_003 language "XSD" all; + + template E1 m_msg := "2014-04-12+01:00"; //+01:00 for CE + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060504_date_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060504_date_003.xml", { "Pos_060504_date_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060504_date_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..16c1fb85e90eed5b20d643be34c9495d726d8a8b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xml @@ -0,0 +1,4 @@ + +2014-04-12+01:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..82057bacb55c71a2e236d3f6a21aaadf44f099b6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_003/Pos_060504_date_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8716303bf124534511db734c587d64ac0a2fe4ee --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.4, Verify that the date type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060504_date_004 { + + import from schema_Pos_060504_date_004 language "XSD" all; + + template E1 m_msg := "2004-04-12Z"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060504_date_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060504_date_004.xml", { "Pos_060504_date_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060504_date_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..34d9bba31feb0f63b4c324b9f3819f1e8112853c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xml @@ -0,0 +1,4 @@ + +2004-04-12Z diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a55a975289e725839cf5a19c46fbff392ca30f76 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060504_date/Pos_060504_date_004/Pos_060504_date_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cb9fa3ffc6fdccbbb95ad553eaeb8dddda13139c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060505_gregorian_year_and_month_001 { + + import from schema_Neg_060505_gregorian_year_and_month_001 language "XSD" all; + + template E1 m_msg := "99-04"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060505_gregorian_year_and_month_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060505_gregorian_year_and_month_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..137615fe94eabb68dca467f7a13160f237c39623 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_001/Neg_060505_gregorian_year_and_month_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ccf8b45440ef824c9c928aec481497f8efea428 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060505_gregorian_year_and_month_002 { + + import from schema_Neg_060505_gregorian_year_and_month_002 language "XSD" all; + + template E1 m_msg := "2014"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060505_gregorian_year_and_month_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060505_gregorian_year_and_month_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..bfcc3be096d093fafd081b90dc8d274a3910c9ab --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_002/Neg_060505_gregorian_year_and_month_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6573925711e7c80fa911306ae185f82153fc020e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060505_gregorian_year_and_month_003 { + + import from schema_Neg_060505_gregorian_year_and_month_003 language "XSD" all; + + template E1 m_msg := "2004-4"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060505_gregorian_year_and_month_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060505_gregorian_year_and_month_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..17a002fc1f0ed6167f55a51e41ea9a92abf51ca6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_003/Neg_060505_gregorian_year_and_month_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80f43a00914433064e2ab732d5e4864ff424e799 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060505_gregorian_year_and_month_004 { + + import from schema_Neg_060505_gregorian_year_and_month_004 language "XSD" all; + + template E1 m_msg := "2004-13"; //wrong format + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060505_gregorian_year_and_month_004() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060505_gregorian_year_and_month_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..21d0872a5152c0e010904cf710ff4f9ea746ef31 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Neg_060505_gregorian_year_and_month_004/Neg_060505_gregorian_year_and_month_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d0d261238672b806dbe6e1b87ac64d125964b19 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060505_gregorian_year_and_month_001 { + + import from schema_Pos_060505_gregorian_year_and_month_001 language "XSD" all; + + template E1 m_msg := "2014-04"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060505_gregorian_year_and_month_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060505_gregorian_year_and_month_001.xml", { "Pos_060505_gregorian_year_and_month_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060505_gregorian_year_and_month_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..741c3ea9201ee26a91536edc6388c24f594f5078 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xml @@ -0,0 +1,4 @@ + +2014-04 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e1baf5685e2034b779cb7ca271fa9f6a4de97e45 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_001/Pos_060505_gregorian_year_and_month_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b14d3c3cf7037c3ded0eaf70ba7d025dd9214662 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.5, Verify that the gYearMonth type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060505_gregorian_year_and_month_002 { + + import from schema_Pos_060505_gregorian_year_and_month_002 language "XSD" all; + + template E1 m_msg := "2014-04-05:00"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060505_gregorian_year_and_month_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060505_gregorian_year_and_month_002.xml", { "Pos_060505_gregorian_year_and_month_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060505_gregorian_year_and_month_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..51a294c67dbb31da814a7e796d0e312c93dc564e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xml @@ -0,0 +1,4 @@ + +2014-04-05:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8ca66a62508a7e5997032a834bf70fe6ebbd620a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060505_gregorian_year_and_month/Pos_060505_gregorian_year_and_month_002/Pos_060505_gregorian_year_and_month_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25c0c1cb4331398c69f39055c34a41c34c73d335 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.ttcn @@ -0,0 +1,45 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass reject + ***************************************************/ +module Neg_060506_gregorian_year_001 { + + import from schema_Neg_060506_gregorian_year_001 language "XSD" all; + + template E1 m_msg := "99"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_060506_gregorian_year_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_060506_gregorian_year_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..66463d68ea510f25b672a8f7b57634cdb9d8ce62 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Neg_060506_gregorian_year_001/Neg_060506_gregorian_year_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..581ce5f772f2a6b8b74f77b0bc82e868e430d50e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_001 { + + import from schema_Pos_060506_gregorian_year_001 language "XSD" all; + + template E1 m_msg := "2014"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_001.xml", { "Pos_060506_gregorian_year_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb498fbad2b9cf6217caa282b123c2d6f8d4855c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xml @@ -0,0 +1,4 @@ + +2014 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4d6ceab61a305b0f5290e046dcf88cb90f12e091 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_001/Pos_060506_gregorian_year_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..da589554a7e3416f358b87413c5f41903c2ca4ce --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_002 { + + import from schema_Pos_060506_gregorian_year_002 language "XSD" all; + + template E1 m_msg := "2014+01:00"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_002.xml", { "Pos_060506_gregorian_year_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f31cdce5485c2ab7852eb2afe0ebde1a37638ea5 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xml @@ -0,0 +1,4 @@ + +2014+01:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d3e21c4a6205ff06c3a0ecfc563e8c6146943636 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_002/Pos_060506_gregorian_year_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c8aa135b0de2112dc5ffae90d543bfd7031697c4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear allows positive years greater than 9999 + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_003 { + + import from schema_Pos_060506_gregorian_year_003 language "XSD" all; + + template E1 m_msg := "12004"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_003.xml", { "Pos_060506_gregorian_year_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..4dfd21f37b15328bc209708aba12d9cadce72ee6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xml @@ -0,0 +1,4 @@ + +12004 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cf2e1e226460b58d79f094b9a620ec177681f44c --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_003/Pos_060506_gregorian_year_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8625c25589ad02af7a9e8b5a013e453e21d4a2e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear type shall be translated to TTCN-3 using the pattern-restricted charstring + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_004 { + + import from schema_Pos_060506_gregorian_year_004 language "XSD" all; + + template E1 m_msg := "0922"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_004.xml", { "Pos_060506_gregorian_year_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..4e442b9d47cee28f30f5f48ee44995389237daba --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xml @@ -0,0 +1,4 @@ + +0922 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..aaefd2fae07a0b482fe14ea04a841f85cf618a09 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_004/Pos_060506_gregorian_year_004.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..188998f4b95992f4a9f950b2feeb7b1dbbd7812a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear accepts negative years + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_005 { + + import from schema_Pos_060506_gregorian_year_005 language "XSD" all; + + template E1 m_msg := "-0045"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_005.xml", { "Pos_060506_gregorian_year_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..343f27b45ee2d968eaf98ee3298c90b563579702 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xml @@ -0,0 +1,4 @@ + +-0045 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..675e910732d5efcf2d4b9b689d2cbce720c635e4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_005/Pos_060506_gregorian_year_005.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b0d00ba583b26d08873e752a252d58b9db669919 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.5.6, Verify that the gYear alows negative year with more than 4 digits + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060506_gregorian_year_006 { + + import from schema_Pos_060506_gregorian_year_006 language "XSD" all; + + template E1 m_msg := "-210045"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060506_gregorian_year_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060506_gregorian_year_006.xml", { "Pos_060506_gregorian_year_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060506_gregorian_year_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec64fc2975fa308f740a5bf49728eb3650ec9c9b --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xml @@ -0,0 +1,4 @@ + +-210045 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7bb2952b538c23f483869196d12f9795255ff866 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060506_gregorian_year/Pos_060506_gregorian_year_006/Pos_060506_gregorian_year_006.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a77bd319c1f43f47b4997a962b481f2e71bc870e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.5.7, Verify mapping of the gMonthDay type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060507_gregorian_month_and_day_001 { + + import from schema_Pos_060507_gregorian_month_and_day_001 language "XSD" all; + + template Test m_msg := "--04-05"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060507_gregorian_month_and_day_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060507_gregorian_month_and_day_001.xml", { "Pos_060507_gregorian_month_and_day_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060507_gregorian_month_and_day_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..062fc42ea12cb350759e460aa6c0f06b5e2affaf --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xml @@ -0,0 +1,3 @@ + +--04-05 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..48a3d30bc39ce00f502abfd05aa95cb37d17b941 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060507_gregorian_month_and_day/Pos_060507_gregorian_month_and_day_001/Pos_060507_gregorian_month_and_day_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fea315a2ef12283df9363b37ce9bc9836ec2f1d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.5.8, Verify mapping of the gDay type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060508_gregorian_day_001 { + + import from schema_Pos_060508_gregorian_day_001 language "XSD" all; + + template Test m_msg := "---01+02:00"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060508_gregorian_day_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060508_gregorian_day_001.xml", { "Pos_060508_gregorian_day_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060508_gregorian_day_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..e92a225098b1311d59288ced4f52b4f4920af630 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xml @@ -0,0 +1,3 @@ + +---01+02:00 diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a9ad42ec20f49223ca546eec58f5295f2dd520ea --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060508_gregorian_day/Pos_060508_gregorian_day_001/Pos_060508_gregorian_day_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.ttcn b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91cc7d64d13a36cf439defbf5c5f7e795f5fa035 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.5.9, Verify mapping of the gMonth type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060509_gregorian_month_001 { + + import from schema_Pos_060509_gregorian_month_001 language "XSD" all; + + template Test m_msg := "--11Z"; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060509_gregorian_month_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060509_gregorian_month_001.xml", { "Pos_060509_gregorian_month_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060509_gregorian_month_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xml b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa4b9c770f3d896bcf92d6a57f798fcfa852c561 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xml @@ -0,0 +1,3 @@ + +--11Z diff --git a/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xsd b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..55e1645e4ee34447b67c1a6316dacc8c560fabb4 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0605_time_types/060509_gregorian_month/Pos_060509_gregorian_month_001/Pos_060509_gregorian_month_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.ttcn b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e7228b729fa6ad7ce077d5317869b03c3d284f9f --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.6.1, Verify mapping of a NMTOKENS type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060601_nmtokens_001 { + + import from schema_Pos_060601_nmtokens_001 language "XSD" all; + + template Test m_msg := { "brought", "classical", "music", "to", "the", "Peanuts", "strip" }; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060601_nmtokens_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060601_nmtokens_001.xml", { "Pos_060601_nmtokens_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060601_nmtokens_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xml b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..259e92c89a6c8b3385a147e0eac78677fa0d4b53 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xml @@ -0,0 +1,3 @@ + +brought classical music to the Peanuts strip diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xsd b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..076f84a810f549002bd8f7a778c88c87ee1a5fd8 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060601_nmtokens/Pos_060601_nmtokens_001/Pos_060601_nmtokens_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.ttcn b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..45215459d46ac80a3bbefb70cccc089e54a6dd52 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.6.2, Verify mapping of a IDREFS type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060602_idrefs_001 { + + import from schema_Pos_060602_idrefs_001 language "XSD" all; + + template Test m_msg := { + item_list := { "abc", "def", "ghi" }, + itemrefs := { "ghi", "def", "abc" } + } + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060602_idrefs_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060602_idrefs_001.xml", { "Pos_060602_idrefs_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060602_idrefs_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xml b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..368c97bd888bcb252bc1a2bf26f2ef3a6df50f56 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xml @@ -0,0 +1,8 @@ + + + abc + def + ghi + ghi def abc + diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xsd b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..74b71ba91b028ed5a2eaa7066a942aee19c47639 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060602_idrefs/Pos_060602_idrefs_001/Pos_060602_idrefs_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.ttcn b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ffc929ac873bd7cffc84911fe1a0f8422af2e8e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.6.4, Verify mapping of the QName type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_060604_qname_001 { + + import from schema_Pos_060604_qname_001 language "XSD" all; + + template Test m_msg := { + uri := "schema:Pos_060604_qname_001", + name := "test" + }; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_060604_qname_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_060604_qname_001.xml", { "Pos_060604_qname_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_060604_qname_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xml b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c6b10ec80afb3610ed42f40442e4b7f77bd23c0d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xml @@ -0,0 +1,3 @@ + +ns:test diff --git a/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xsd b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1c7b4836c34b7d30214ef07af9bf35dc5b622857 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0606_sequence_types/060604_qname/Pos_060604_qname_001/Pos_060604_qname_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.ttcn b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c0e3a04544543b499494e497aabd3b5ce04b3119 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.7, Verify that the XSD boolean type shall be mapped to the TTCN-3 boolean type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_0607_boolean_type_001 { + + import from schema_Pos_0607_boolean_type_001 language "XSD" all; + + template E1 m_msg := true; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0607_boolean_type_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0607_boolean_type_001.xml", { "Pos_0607_boolean_type_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0607_boolean_type_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xml b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8e01051230f6219454164ec1aadaf370ed208077 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xml @@ -0,0 +1,4 @@ + +true diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xsd b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1b17dfeb86ce3c0d461839376aa968f9a75db5e3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_001/Pos_0607_boolean_type_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.ttcn b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0a0534ee70340e58cc95b8609d2fb445e0348ad6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.ttcn @@ -0,0 +1,79 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.7, Verify that the XSD boolean type shall be mapped to the TTCN-3 boolean type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_0607_boolean_type_002 { + + import from schema_Pos_0607_boolean_type_002 language "XSD" all; + + template E1 m_msg := false; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0607_boolean_type_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0607_boolean_type_002.xml", { "Pos_0607_boolean_type_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0607_boolean_type_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xml b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..a21d6bd6c523017f5db81ffb89bd059e3d103883 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xml @@ -0,0 +1,4 @@ + +false diff --git a/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xsd b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2e06c0e080bba52ac3b7bdac24f36cfa7dc0240d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0607_boolean_type/Pos_0607_boolean_type_002/Pos_0607_boolean_type_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..924bf80bb6a6d71db94aa7c548a75239bcb45321 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of anySimpleType + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD anySimpleType can be considered as the base type of all primitive +// data types. The anySimpleType shall be translated as an XML compatible +// restricted subtype of the universal charstring. + +module Pos_0608_anytype_and_anysimpletype_types_001 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_001 language "XSD" all; + + template MyType m_msg := "test"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_001.xml", { "Pos_0608_anytype_and_anysimpletype_types_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..061ea0ec4c783060629519e4bf3ec74a2fd5824a --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xml @@ -0,0 +1,2 @@ + +test \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9a833fc556799b4735eec22db86a8a17a8093729 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_001/Pos_0608_anytype_and_anysimpletype_types_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d19215fe1c198a821c89489d755ea1e1696dee7 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of anyType + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD anyType is the base type of all complex definitions and the +// anySimpleType. AnyType is translated into XML content opaque to the codec. + +module Pos_0608_anytype_and_anysimpletype_types_002 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_002 language "XSD" all; + + template MyType m_msg := { + embed_values := omit, + attr := {"schema:Pos_0608_anytype_and_anysimpletype_types_002 attr=""abc"""}, + elem_list := { + "foo", + "bar" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_002.xml", { "Pos_0608_anytype_and_anysimpletype_types_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..67226185dc4ca9cf148904a3a47db5576790dfcf --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xml @@ -0,0 +1,2 @@ + +foobar \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e1ab521049ddea1077c0b99994caf71a8469745e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_002/Pos_0608_anytype_and_anysimpletype_types_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e45a24f9502194336a70cf514489ea10b5c88ed --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.8, Conversion of anyType with mixed content + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An element of anyType is able to carry any syntactically valid (well-formed) +// XML content, including mixed content. Each TTCN-3 element of the field attr +// shall contain a complete, valid XML attribute, including its name and value. +// Each TTCN-3 element of the field elem_list shall contain a syntactically valid +// XML element. If the embed_values field is not omitted in the TTCN-3 value or +// template instance, its content shall be handled according to clause 7.6.8. + +module Pos_0608_anytype_and_anysimpletype_types_003 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_003 language "XSD" all; + + template MyType m_msg := { + embed_values := { "The ordered ", " has arrived. ", " not delivered yet."}, + attr := {"schema:Pos_0608_anytype_and_anysimpletype_types_003 attr=""abc"""}, + elem_list := { + "foo", + "bar" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_003.xml", { "Pos_0608_anytype_and_anysimpletype_types_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..33c04303f95d773cd1b161d09378cce4eb029910 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xml @@ -0,0 +1,2 @@ + +The ordered foo has arrived. bar not delivered yet. \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a48ae8a6139dbf1497d62c09669673813e997fc6 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_003/Pos_0608_anytype_and_anysimpletype_types_003.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58e7672c1df502283a57f66292c4bf2efe2a8a29 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.8, Nillable anyType element (nill option, content not present) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An element of anyType is able to carry any syntactically valid (well-formed) +// XML content, including mixed content. Each TTCN-3 element of the field attr +// shall contain a complete, valid XML attribute, including its name and value. +// Each TTCN-3 element of the field elem_list shall contain a syntactically valid +// XML element. If the embed_values field is not omitted in the TTCN-3 value or +// template instance, its content shall be handled according to clause 7.6.8. + +module Pos_0608_anytype_and_anysimpletype_types_004 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_004 language "XSD" all; + + template MyType m_msg := { + content := omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_004.xml", { "Pos_0608_anytype_and_anysimpletype_types_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..839b8ae3fb0add5778898d06dc187c609aaf4260 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ef79f8e5af0c4f87a5edf12e791b34d448e1f85d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_004/Pos_0608_anytype_and_anysimpletype_types_004.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..acb32784add10106931bc87c249507181ad5a27e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.8, Nillable anyType element (content is present) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The following requirements are tested: +// An element of anyType is able to carry any syntactically valid (well-formed) +// XML content, including mixed content. Each TTCN-3 element of the field attr +// shall contain a complete, valid XML attribute, including its name and value. +// Each TTCN-3 element of the field elem_list shall contain a syntactically valid +// XML element. If the embed_values field is not omitted in the TTCN-3 value or +// template instance, its content shall be handled according to clause 7.6.8. + +module Pos_0608_anytype_and_anysimpletype_types_005 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_005 language "XSD" all; + + template MyType m_msg := { + content := { + embed_values := omit, + attr := omit, + elem_list := { + "foo", + "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0608_anytype_and_anysimpletype_types_005.xml", { "Pos_0608_anytype_and_anysimpletype_types_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..041d89b2795f8d213aeed850fe087f41ca68013d --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xml @@ -0,0 +1,2 @@ + +foobar \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..283527438a497008248d6ae509c3ff0aaaa055fc --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_005/Pos_0608_anytype_and_anysimpletype_types_005.xsd @@ -0,0 +1,8 @@ + + + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b704382afa5414ba72b0358ad17dd1ab5ca6ec86 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of XSD anySimpleType to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_Pos_0608_anytype_and_anysimpletype_types_006 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_006 language "XSD" all; + + template MyType m_msg := { integer := 1 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_006() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..3967ff9a869fed321fd4948d5ae491f675faa9df --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..08dae172898c57f4fd64551006433ec500c2c8b0 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_006/Pos_0608_anytype_and_anysimpletype_types_006.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..199156317fc9b0f57523ed0a080f8a12bf28f86e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:6.8, Verify conversion of XSD anyType to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_Pos_0608_anytype_and_anysimpletype_types_007 { + + import from schema_Pos_0608_anytype_and_anysimpletype_types_007 language "XSD" all; + + template MyType m_msg := { embed_values := omit, attr := omit, elem_list := { { Something := 1 } } }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_0608_anytype_and_anysimpletype_types_007() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0608_anytype_and_anysimpletype_types_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xml b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..79246653ecee3ebae1e682638c3324a652f4be20 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xsd b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e7b9b5d553657e00794e55610d2875195a4143f3 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/0608_anytype_and_anysimpletype_types/Pos_0608_anytype_and_anysimpletype_types_007/Pos_0608_anytype_and_anysimpletype_types_007.xsd @@ -0,0 +1,8 @@ + + + + + + diff --git a/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.ttcn b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f070fb0bf97231fbc09ce672863138324d32d55e --- /dev/null +++ b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:6, Verify conversion of simpleType based on built-in XSD type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// XSD built-in data types may be primitive or derived types. The latter are +// gained from primitive types by means of a restriction mechanism called +// facets. For the mapping of primitive types, a specific TTCN-3 module XSD is +// provided by the present document, which defines the relation of XSD primitive +// types to TTCN-3 types. Whenever a new simpleType is defined, with +// a built-in XSD type as its base type, it shall be mapped directly from types +// defined in the module XSD. + +module Pos_06_top_level_001 { + + import from schema_Pos_06_top_level_001 language "XSD" all; + + template E1 m_base := 5; + template MyType m_msg := m_base; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_06_top_level_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_06_top_level_001.xml", { "Pos_06_top_level_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_06_top_level_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xml b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1551b8968528878e16f33d6c2ac3b5734ca0141 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xsd b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..000df5b6b68b1fa995deb6a54bba271bfc65a928 --- /dev/null +++ b/ATS/xml/06_built_in_data_types/06_top_level/Pos_06_top_level_001/Pos_06_top_level_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..51e045e373b36bc888ab49bd5b7a7cb750443b93 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.1, Verify conversion of id attribute of global element + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The attribute id enables a unique identification of an XSD component. They +// shall be mapped to TTCN-3 as simple type references, e.g. any component +// mapping to a type with name typeName and an attribute id="ID" shall result in +// an additional TTCN-3 type declaration. + +module Pos_070101_id_001 { + + import from schema_Pos_070101_id_001 language "XSD" all; + + template ProductType m_base := {name := "Moby Dick", price := "$12.4"}; + template MyType m_msg := m_base; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070101_id_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070101_id_001.xml", { "Pos_070101_id_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070101_id_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..80e6372844c49058d135b766528b565c5053a208 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xml @@ -0,0 +1,5 @@ + + +Moby Dick +$12.4 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9a3630ba2f868a61c4f7890c29d4acb003042779 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_001/Pos_070101_id_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..48909c8f00050ee83efc877d0083efe33c4f8b26 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.1, verify conversion of id attribute of local element + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The attribute id enables a unique identification of an XSD component. They +// shall be mapped to TTCN-3 as simple type references, e.g. any component +// mapping to a type with name typeName and an attribute id="ID" shall result in +// an additional TTCN-3 type declaration. + +module Pos_070101_id_002 { + + import from schema_Pos_070101_id_002 language "XSD" all; + + template E01 m_base := "test"; + template MyType m_msg := { + foo := m_base + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070101_id_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070101_id_002.xml", { "Pos_070101_id_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070101_id_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe953a7b1bdb2135dea4a913071e363979a21f68 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xml @@ -0,0 +1,4 @@ + + + test + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d581a968d6a3ad05bc3c692709b7b773077eb588 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070101_id/Pos_070101_id_002/Pos_070101_id_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4653ef794f748cf94758501f885fe0cf3ab2000 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.ttcn @@ -0,0 +1,47 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, a list with minOccurs 0 should not be mapped optional in TTCN-3 + ** @verdict pass reject + ***************************************************/ +module Neg_070104_minoccurs_and_maxoccurs_001 { + + import from schema_Neg_070104_minoccurs_and_maxoccurs_001 language "XSD" all; + + // foo_list should not be optional + template ElemE15b m_msg := {foo_list := omit, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_070104_minoccurs_and_maxoccurs_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_070104_minoccurs_and_maxoccurs_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..472e75306d6c4cd9a5830164c64cf8d3a68b409c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_001/Neg_070104_minoccurs_and_maxoccurs_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fa4af4876bde27e420cd4952f0387549188b2c7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list [5, 10] should not allow less than 5 elements + ** @verdict pass reject + ***************************************************/ +module Neg_070104_minoccurs_and_maxoccurs_002 { + + import from schema_Neg_070104_minoccurs_and_maxoccurs_002 language "XSD" all; + + template ElemE15c m_msg := {foo_list := {1, 2, 3, 4}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_070104_minoccurs_and_maxoccurs_002() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_070104_minoccurs_and_maxoccurs_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a45f19f8da3979b603af66239776e781f763595c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_002/Neg_070104_minoccurs_and_maxoccurs_002.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c8d23e4b1cd44246c49bddc5b8e76e9beb2666b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.ttcn @@ -0,0 +1,46 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list [5, 10] should not allow more than 10 elements + ** @verdict pass reject + ***************************************************/ +module Neg_070104_minoccurs_and_maxoccurs_003 { + + import from schema_Neg_070104_minoccurs_and_maxoccurs_003 language "XSD" all; + + template ElemE15c m_msg := {foo_list := {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_070104_minoccurs_and_maxoccurs_003() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_070104_minoccurs_and_maxoccurs_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6f812947653b7179f068c696c809151cec3c2762 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Neg_070104_minoccurs_and_maxoccurs_003/Neg_070104_minoccurs_and_maxoccurs_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..76209dd262f65a4ee23fd2f14596f4527d35b16e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, Optional field defined by minOccurs has to be mapped as optional in TTCN-3 + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_001 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_001 language "XSD" all; + + template ElemE15a m_msg := {foo := omit, bar := 2.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_001.xml", { "Pos_070104_minoccurs_and_maxoccurs_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..9fa3d1b7a31e4f71448ea538ea536402a010ffa3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xml @@ -0,0 +1,4 @@ + + + 2.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ddb0865eee24426f6fc6bb46cec3536d4fc7792b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_001/Pos_070104_minoccurs_and_maxoccurs_001.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..534dbe88eb154b516476cf8682972c681f792f32 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, Optional field defined by minOccurs has to exist in TTCN-3 and match the value + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_002 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_002 language "XSD" all; + + template ElemE15a m_msg := {foo := 5, bar := 2.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_002.xml", { "Pos_070104_minoccurs_and_maxoccurs_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..1c16f2ddee2fdcbe2fe3becf9c8ede6a3396f396 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xml @@ -0,0 +1,5 @@ + + + 5 + 2.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..eda26ff9e177b2640ce13bd6802f4cda50c975a0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_002/Pos_070104_minoccurs_and_maxoccurs_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..82fa200ca87fc040ba092a4a74ac7829f06d5f8d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, a list with minOccurs 0 should allow zero elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_003 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_003 language "XSD" all; + + template ElemE15b m_msg := {foo_list := {}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_003.xml", { "Pos_070104_minoccurs_and_maxoccurs_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..036ca8e5362b42b32ec7d9c57328c8b6b0c9fef7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xml @@ -0,0 +1,4 @@ + + + 3.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7abfcb15f9498467c6b5327a11dc24896238b809 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_003/Pos_070104_minoccurs_and_maxoccurs_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4e0047983f54557f34f202689a189003f67dff61 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list (0, unbounded) should allow elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_004 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_004 language "XSD" all; + + template ElemE15b m_msg := {foo_list := {1, 2, 3, 4, 5}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_004.xml", { "Pos_070104_minoccurs_and_maxoccurs_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..79d796984deabf2fb6cb878add0c890f9c11790f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xml @@ -0,0 +1,9 @@ + + + 1 + 2 + 3 + 4 + 5 + 3.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..edd40757a808fe30d7f6ce97fbb322f7cb7562c5 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_004/Pos_070104_minoccurs_and_maxoccurs_004.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bf91c4b88569a945b9fcba902ff9ec3f9122fd3a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list [5, 10] should allow 5 elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_005 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_005 language "XSD" all; + + template ElemE15c m_msg := {foo_list := {1, 2, 3, 4, 5}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_005.xml", { "Pos_070104_minoccurs_and_maxoccurs_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..817efad5d1ce0d9a78ad4e30dc680b80a38dc093 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xml @@ -0,0 +1,9 @@ + + + 1 + 2 + 3 + 4 + 5 + 3.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d6ba0d8329dc0a471418082199205d9e44655bea --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_005/Pos_070104_minoccurs_and_maxoccurs_005.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..15e0dd533aae384ea298deadbd34d40d362153f9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list [5, 10] should allow 10 elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_006 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_006 language "XSD" all; + + template ElemE15c m_msg := {foo_list := {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, bar := 3.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_006.xml", { "Pos_070104_minoccurs_and_maxoccurs_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f1fdf14e36548c69b4d7cf9cf378b24f5736224 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xml @@ -0,0 +1,14 @@ + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 3.0 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..64192b63cca402885614ff4ba2e7d7c802478aa6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_006/Pos_070104_minoccurs_and_maxoccurs_006.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f09aa4833176752f317e13b7a3d1683a00d86e8f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.4, A restricted length list [5, 10] should allow 7 elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070104_minoccurs_and_maxoccurs_007 { + + import from schema_Pos_070104_minoccurs_and_maxoccurs_007 language "XSD" all; + + template ElemE15c m_msg := {foo_list := {1, 2, 3, 4, 5, 6, 7}, bar := 15.0} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070104_minoccurs_and_maxoccurs_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070104_minoccurs_and_maxoccurs_007.xml", { "Pos_070104_minoccurs_and_maxoccurs_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070104_minoccurs_and_maxoccurs_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..fca38cbbf18505fbfdb0a29ebac1ec050666edbd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xml @@ -0,0 +1,11 @@ + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 15.0 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3714524663a0bcdbf5e99d3fe07413ef2b739567 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070104_minoccurs_and_maxoccurs/Pos_070104_minoccurs_and_maxoccurs_007/Pos_070104_minoccurs_and_maxoccurs_007.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..778ec1eea940983f0b4c77f4f7a3d9cde3936a39 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.ttcn @@ -0,0 +1,54 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.5, Verify constraint of type based on XSD definition with fixed attribute + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// The fixed attribute applied to attribute or element elements shall be mapped +// to a subtype definition with the single allowed value identical to the value +// of the fixed attribute plus a "defaultForEmpty …" encoding instruction +// identifying the value of the fixed attribute as well. The fixed attribute +// applied to XSD facets shall be ignored. + +module Neg_070105_default_and_fixed_001 { + + import from schema_Neg_070105_default_and_fixed_001 language "XSD" all; + + template MyType m_msg := "notFixedValue"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_070105_default_and_fixed_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_070105_default_and_fixed_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..19b2046d7baccce85bc68d3465e7c6c787646867 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Neg_070105_default_and_fixed_001/Neg_070105_default_and_fixed_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ebe02323e2cd4054b39f8e9d00211bcf8e85e0db --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.5, Verify conversion of fixed attribute + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The fixed attribute applied to attribute or element elements shall be mapped +// to a subtype definition with the single allowed value identical to the value +// of the fixed attribute plus a "defaultForEmpty …" encoding instruction +// identifying the value of the fixed attribute as well. The fixed attribute +// applied to XSD facets shall be ignored. + +module Pos_070105_default_and_fixed_001 { + + import from schema_Pos_070105_default_and_fixed_001 language "XSD" all; + + template MyType m_msg := "fixedValue"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070105_default_and_fixed_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070105_default_and_fixed_001.xml", { "Pos_070105_default_and_fixed_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070105_default_and_fixed_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d02071b941c17b8cde4fb990e69a58fd88a35b28 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xml @@ -0,0 +1,2 @@ + +fixedValue \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..97ef8b4f2588425309a518727d6d8698f8cd6a4a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_001/Pos_070105_default_and_fixed_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6b17f0a3e4c99bb5b9a8a1c7744faa5619fd1533 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.5, Verify conversion of default attribute + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// As default has no equivalent in TTCN-3 space, it shall be mapped to +// a "defaultForEmpty …" encoding instruction. + +module Pos_070105_default_and_fixed_002 { + + import from schema_Pos_070105_default_and_fixed_002 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070105_default_and_fixed_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070105_default_and_fixed_002.xml", { "Pos_070105_default_and_fixed_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070105_default_and_fixed_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..e8ca2351c9edd6ba51a552772b747fbab24fb824 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xml @@ -0,0 +1,4 @@ + + + foo + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..30a096af7e1e779f03553d12df9af1fa9c424121 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_002/Pos_070105_default_and_fixed_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e1ca88d087ba77eba43fce4ede52b7814b2c5e3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.5, Verify that default value is automatically assigned to empty element by decoder + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// As default has no equivalent in TTCN-3 space, it shall be mapped to +// a "defaultForEmpty …" encoding instruction. +// From B.3.7: This encoding instruction ... designates that the decoder shall +// insert the value specified by freetext if the corresponding attribute is +// omitted or when the corresponding element appears without any content in the +// XML instance being decoded; it has no effect in other cases. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070105_default_and_fixed_003 { + + import from schema_Pos_070105_default_and_fixed_003 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc Read a UTF-8 formated XML file from disc. + * @param p_referenceXmlFile the XML file + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return the UTF-8 contents of p_referenceXmlFile + */ + external function readFile(universal charstring p_referenceXmlFile, universal charstring p_referenceTTCN3File := __FILE__) return universal charstring; + + testcase TC_Pos_070105_default_and_fixed_003() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + v_rcv := readFile("Pos_070105_default_and_fixed_003.xml"); + + // send the encoded the message + p.send(v_rcv); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // decode the message + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070105_default_and_fixed_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..43fb980400bd53361fdac56a224b7821eb1f9c06 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3247045aa83a47dfbce4b237416c8d726fbb15c5 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_003/Pos_070105_default_and_fixed_003.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b87bbc8c9e57da6391a6e3f47effc79bd29d16ad --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.5, Verify that fixed value is automatically assigned to empty element by decoder + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The fixed attribute applied to attribute or element elements shall be mapped +// to a subtype definition with the single allowed value identical to the value +// of the fixed attribute plus a "defaultForEmpty …" encoding instruction +// identifying the value of the fixed attribute as well. +// From B.3.7: This encoding instruction ... designates that the decoder shall +// insert the value specified by freetext if the corresponding attribute is +// omitted or when the corresponding element appears without any content in the +// XML instance being decoded; it has no effect in other cases. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070105_default_and_fixed_004 { + + import from schema_Pos_070105_default_and_fixed_004 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc Read a UTF-8 formated XML file from disc. + * @param p_referenceXmlFile the XML file + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return the UTF-8 contents of p_referenceXmlFile + */ + external function readFile(universal charstring p_referenceXmlFile, universal charstring p_referenceTTCN3File := __FILE__) return universal charstring; + + testcase TC_Pos_070105_default_and_fixed_004() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + v_rcv := readFile("Pos_070105_default_and_fixed_004.xml"); + + // send the encoded the message + p.send(v_rcv); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // decode the message + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070105_default_and_fixed_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..2c61b1080699fda206df535c81e13c8602bc1fea --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..abea4ade0783e90190d93934e7d4a137d1e109f4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070105_default_and_fixed/Pos_070105_default_and_fixed_004/Pos_070105_default_and_fixed_004.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0781107009c8f9626869d4d45f68257001c28bee --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that unqualified attribute form is correctly converted (unqualified attributeFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of the form attribute is ... unqualified and no +// attributeFormQualified encoding instruction is assigned to the corresponding +// TTCN-3 module, the form attribute shall be ignored. + +module Pos_070106_form_001 { + + import from schema_Pos_070106_form_001 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := "attr", + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_001.xml", { "Pos_070106_form_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..b45fa50fde20d4a9567d4e5ac7f1831a73763881 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3ce47e7e84d3b05c29ff5ebedee993759566be92 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_001/Pos_070106_form_001.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1356948e76d7e5a66ee3387ff2125bb4a8cee347 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that unqualified attribute form is correctly converted (qualified attributeFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of a form attribute of an XSD attribute declaration is +// unqualified and the attributeFormQualified encoding instruction is attached +// to the target TTCN-3 module ... a "form as unqualified" encoding instruction +// shall be attached to the TTCN-3 field resulted from mapping the given XSD +// attribute ... declaration. + +module Pos_070106_form_002 { + + import from schema_Pos_070106_form_002 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := "attr", + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_002.xml", { "Pos_070106_form_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..0688535f3479d3b78b9295e15129b9b6aa52f5ff --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f7320229bd62a3b0e60b007eb9afc272510164aa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_002/Pos_070106_form_002.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6cb03c179f1f518325526faa9f524869ee6afdfb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that qualified attribute form is correctly converted (unqualified attributeFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of a form attribute of an XSD attribute declaration is qualified +// and no attributeFormQualified encoding instruction is attached to the target +// TTCN-3 module ... a "form as qualified" encoding instruction shall be +// attached to the TTCN-3 field resulted from mapping the given XSD attribute +// ... declaration. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070106_form_003 { + + import from schema_Pos_070106_form_003 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := "attr", + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_003.xml", { "Pos_070106_form_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..eb4840895444791a51f3422931333328e34cb7e9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3b4641db693585e999f70192f980f43da164b91c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_003/Pos_070106_form_003.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8684d29de5a97e47f77b5227aad12e7c61e70994 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that qualified attribute form is correctly converted (qualified attributeFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of the form attribute is qualified and the +// attributeFormQualified encoding instruction is attached to the TTCN-3 module +// the given XSD declaration contributes to ... the form attribute shall be +// ignored. + +module Pos_070106_form_004 { + + import from schema_Pos_070106_form_004 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := "attr", + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_004.xml", { "Pos_070106_form_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..f5a0e995defcd0fafe028150e4d90edf34dceb6f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..300e50864a8be1a063bfd6da3f2a3fbbe0b69764 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_004/Pos_070106_form_004.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..df8cb06e5e9f63043c7419139caf278a7dbdcd1a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that unqualified element form is correctly converted (unqualified elementFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD form attribute controls if an attribute or element tag shall be +// encoded in XML by using a qualified or unqualified name. The values of the +// form attributes shall be preserved in the "form as…" encoding instructions. + +module Pos_070106_form_005 { + + import from schema_Pos_070106_form_005 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_005.xml", { "Pos_070106_form_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..839cce4586b23678ea2309fd4326575ac489e3e8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xml @@ -0,0 +1,4 @@ + + + foo + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3104ce7d74e064c1354edd2ac9c46a2fa5e4cc8b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_005/Pos_070106_form_005.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c130611212c7d94af6de17665f7188634c2622e9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that unqualified element form is correctly converted (qualified elementFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If ... the value of a form attribute of an element declaration is unqualified +// and the elementFormQualified encoding instruction is attached to the target +// TTCN-3 module, a "form as unqualified" encoding instruction shall be attached +// to the TTCN-3 field resulted from mapping the given XSD ... element +// declaration. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070106_form_006 { + + import from schema_Pos_070106_form_006 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_006.xml", { "Pos_070106_form_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..915880addb72df3cb405499d9a9650d7b3ec526d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xml @@ -0,0 +1,4 @@ + + + foo + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4b12e73487827d300b828a7a1791adeb10bf4b00 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_006/Pos_070106_form_006.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..742ca7e37de633cdfa56ac2c7622b7dd6bda3c8d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that qualified element form is correctly converted (unqualified elementFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If ... the value of a form attribute of an element declaration is qualified +// and no elementFormQualified encoding instruction is attached to the target +// TTCN-3 module, a "form as qualified" encoding instruction shall be attached +// to the TTCN-3 field resulted from mapping the given XSD attribute or element +// declaration. + +module Pos_070106_form_007 { + + import from schema_Pos_070106_form_007 language "XSD" all; + + template MyType m_msg := { + foo:="foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_007.xml", { "Pos_070106_form_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..662535549eeca1ffa7663c18a66f75f1a0ceb138 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xml @@ -0,0 +1,4 @@ + + + foo + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0cb9a6fc0eb4cecc74b3387a5322be8730fc0d0b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_007/Pos_070106_form_007.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1e1c672b0747f0a8cf6bfed87cf6fb702346fdc1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.6, Verify that qualified element form is correctly converted (qualified elementFormDefault) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD form attribute controls if an attribute or element tag shall be +// encoded in XML by using a qualified or unqualified name. The values of the +// form attributes shall be preserved in the "form as…" encoding instructions. + +module Pos_070106_form_008 { + + import from schema_Pos_070106_form_008 language "XSD" all; + + template MyType m_msg := { + foo := "foo" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_008.xml", { "Pos_070106_form_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_008(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xml new file mode 100644 index 0000000000000000000000000000000000000000..a77a15bb5e374c04541f1709fe2e187d8119ff95 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xml @@ -0,0 +1,4 @@ + + + foo + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cf7c401b0c88eebe35970d9b179c559926f0f307 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b87fe1cb1b820bad2b111e7021fcd77d9f7567b4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:7.1.6, check correct namespace prefix encoding for elementFormDefault + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070106_form_009 { + + import from schema_Pos_070106_form_009 language "XSD" all; + + template MyElement m_msg := { + myField := 1, + myField2 := {myField := 2}, + myElement := {myField := 3} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_009() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_009.xml", { "Pos_070106_form_009.xsd", "Pos_070106_form_009_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_009(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ea7d998bdfc69a15c185d64ded14e6fdd8687cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml @@ -0,0 +1,11 @@ + + + 1 + + 2 + + + 3 + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6e31ce8ad12c5463f0ed7bc434654ba5adeed5b1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fc15b47127e9e5af0a22a038a9702f5eaff3aa53 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a886009a7b3f9c707e18cf7a43478c53e01ca62 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.6, check correct namespace prefix encoding for elementFormDefault + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070106_form_010 { + + import from schema_Pos_070106_form_010 language "XSD" all; + + template MyElement m_msg := { + myField := 1, + myField2 := {myField := 2}, + myElement := {myField := 3} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_010() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_010.xml", { "Pos_070106_form_010.xsd", "Pos_070106_form_010_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_010(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml new file mode 100644 index 0000000000000000000000000000000000000000..463825980050dab2fe8c72378d75a50a16c88776 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml @@ -0,0 +1,11 @@ + + + 1 + + 2 + + + 3 + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd new file mode 100644 index 0000000000000000000000000000000000000000..da2d32b4dfb80955f6f039c3aae3d7e2bf8bf616 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..375d9a50a84a3b29dc670a536be0aed303ef3a82 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b43cec1e309904a264337074a11a841a6e961a45 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.6, check correct namespace prefix encoding for attributeFormDefault + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070106_form_011 { + + import from schema_Pos_070106_form_011 language "XSD" all; + + template MyElement m_msg := { + myField := 1, + myField2 := {2}, + myElement := {3} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_011() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_011.xml", { "Pos_070106_form_011.xsd", "Pos_070106_form_011_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_011(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml new file mode 100644 index 0000000000000000000000000000000000000000..d391957d41cc70380195521c118f51c56b8998f4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd new file mode 100644 index 0000000000000000000000000000000000000000..270421ae3eed3a9221d7c5b019a3c1761c2a2bca --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..167c68be6ea2d9cdb9238c389ffc165dbd10c8a7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d8ad553ea8bc6c569632394701d6c2eaba0b56ce --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 487, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.6, check correct namespace prefix encoding for attributeFormDefault + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070106_form_012 { + + import from schema_Pos_070106_form_012 language "XSD" all; + + template MyElement m_msg := { + myField := 1, + myField2 := {2}, + myElement := {3} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070106_form_012() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070106_form_012.xml", { "Pos_070106_form_012.xsd", "Pos_070106_form_012_2.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070106_form_012(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xml new file mode 100644 index 0000000000000000000000000000000000000000..d0d8627a984b92752239463908cbf43b25b456ae --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd new file mode 100644 index 0000000000000000000000000000000000000000..890710f8187f344ed4e80bf7a1eebefdd5af8275 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd new file mode 100644 index 0000000000000000000000000000000000000000..edd09d1d9b1841b6c583f13df6b7d2e8ec66b7b9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97be4cc648c035c1f9e4b560a41852138fce4fea --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.7, Verify conversion of type attribute referencing global simpleType + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD type attribute holds the type information of the XSD component. The +// value is a reference to the global definition of simpleType. + +module Pos_070107_type_001 { + + import from schema_Pos_070107_type_001 language "XSD" all; + + template MyType m_msg := 5; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070107_type_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070107_type_001.xml", { "Pos_070107_type_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070107_type_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..cfbe73611bb8c5a91cd5df67a5318d7a94fd5b22 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..68a59ebb0b1a1415b1cb12e17cba260f1e5d8c8a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4e5511666d581ed55fcbb5a1fc727586f2d343c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.7, Verify conversion of type attribute referencing global complexType + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD type attribute holds the type information of the XSD component. The +// value is a reference to the global definition of complexType. + +module Pos_070107_type_002 { + + import from schema_Pos_070107_type_002 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := 2 + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070107_type_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070107_type_002.xml", { "Pos_070107_type_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070107_type_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..7d98cdae95d9a1ca4e29d8e1de680ef749ba5e4c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xml @@ -0,0 +1,5 @@ + + + foo + 2 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1681d69e782b85f1b13df850bcfd7f29d444d423 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a67ec000fd636dc904fad8dc48ae9a4ffacf5ced --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.7, Verify conversion of type attribute referencing built-in type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD type attribute holds the type information of the XSD component. The +// value is a reference to the global definition of a built-in type. + +module Pos_070107_type_003 { + + import from schema_Pos_070107_type_003 language "XSD" all; + + template MyType m_msg := 5; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070107_type_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070107_type_003.xml", { "Pos_070107_type_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070107_type_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..a42c819a635eddf83555e1fe0e04b2ae52ef407c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0456e0be3e77e2e93fc42d67bbaca47ca465347c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_003/Pos_070107_type_003.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..346a5b497a8acf08bc01b38d69f49c6ae37fc9d3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Simple nillable type (nil option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A simple-type nillable XSD element shall be mapped to a TTCN-3 record type (in case of global +// elements) or field (in case of local elements), with the name resulted by applying clause 5.2.2 +// to the name of the corresponding element. The record type or field shall contain one optional +// field with the name "content" and its type shall be the TTCN 3 type of the element. The record +// type or field shall be appended with the "useNil" encoding instruction. + +module Pos_070111_nillable_001 { + + import from schema_Pos_070111_nillable_001 language "XSD" all; + + template MyType m_msg := { + content := omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_001.xml", { "Pos_070111_nillable_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..aae38b4711b7c104192509a6fcd40cb044b09d1d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xml @@ -0,0 +1,2 @@ + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9eb5f44a6a7803dd5bccac81d5bf29e4181645f7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_001/Pos_070111_nillable_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86c211927e141437b27c5498b780bf45cf5f2d64 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Simple nillable type (value option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A simple-type nillable XSD element shall be mapped to a TTCN-3 record type (in case of global +// elements) or field (in case of local elements), with the name resulted by applying clause 5.2.2 +// to the name of the corresponding element. The record type or field shall contain one optional +// field with the name "content" and its type shall be the TTCN 3 type of the element. The record +// type or field shall be appended with the "useNil" encoding instruction. + +module Pos_070111_nillable_002 { + + import from schema_Pos_070111_nillable_002 language "XSD" all; + + template MyType m_msg := { + content := "abc" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_002.xml", { "Pos_070111_nillable_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ddca6874d4fa91f14fa7d7c24af8a0798d49c93 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xml @@ -0,0 +1,2 @@ + +abc diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c2fdced4a7918f0e516d4c61f468d6ecc4fdf57c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_002/Pos_070111_nillable_002.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bdefe7815d809d5ffd2c42c1a0b389dfd2a5f5cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Nillable element of simple type inside sequence (nil option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A simple-type nillable XSD element shall be mapped to a TTCN-3 record type (in case of global +// elements) or field (in case of local elements), with the name resulted by applying clause 5.2.2 +// to the name of the corresponding element. The record type or field shall contain one optional +// field with the name "content" and its type shall be the TTCN 3 type of the element. The record +// type or field shall be appended with the "useNil" encoding instruction. + +module Pos_070111_nillable_003 { + + import from schema_Pos_070111_nillable_003 language "XSD" all; + + template MyType m_msg := { + foo := 1, + bar := { + content := omit + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_003.xml", { "Pos_070111_nillable_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b1c5d9b82310b0b4fad1afa74f9a8a028259fc3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xml @@ -0,0 +1,5 @@ + + + 1 + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..887c224d052c9d84276d090a7a7ae8bd28dd14e8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_003/Pos_070111_nillable_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83cda8052a2fe38d52f5778efa268df160e7a613 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Nillable element of simple type inside sequence (value option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// A simple-type nillable XSD element shall be mapped to a TTCN-3 record type (in case of global +// elements) or field (in case of local elements), with the name resulted by applying clause 5.2.2 +// to the name of the corresponding element. The record type or field shall contain one optional +// field with the name "content" and its type shall be the TTCN 3 type of the element. The record +// type or field shall be appended with the "useNil" encoding instruction. + +module Pos_070111_nillable_004 { + + import from schema_Pos_070111_nillable_004 language "XSD" all; + + template MyType m_msg := { + foo := 1, + bar := { + content := "abc" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_004.xml", { "Pos_070111_nillable_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..97e5890e977b9b07f3ca7180293362ae9b27765a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xml @@ -0,0 +1,5 @@ + + + 1 + abc + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..56fed89c44f36ff143f2c6056616800dea6a901e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_004/Pos_070111_nillable_004.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18eff9abca6cf7a50f7d6a5c007057e83f039869 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Nillable element of complex type (nil option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// ComplexType XSD elements are mapped to an outer record type or field, according to clause 7.6 . +// When the nillable XSD attribute is allocated to such an element, the element components of the +// complex type shall be enframed by an extra optional TTCN-3 record field. I.e., the attributes +// of the complex-type element, mapped to a field of the outer record, shall not be the members +// of the inner record, generated for the nillable XSD attribute. The name of the inner record +// field shall be the result of applying clause 5.2.2 to the name "content". The outer record, +// corresponding to the complexType component of the nillable element, shall be appended with the +// "useNil" encoding instruction. + +module Pos_070111_nillable_005 { + + import from schema_Pos_070111_nillable_005 language "XSD" all; + + template MyType m_msg := { + bar := 1, + content := omit, + content_1 := omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_005.xml", { "Pos_070111_nillable_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..6580c98f01970ed7050f879389fd6ec2d9ac3972 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xml @@ -0,0 +1,2 @@ + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e048e2f88ac635f8e023b6547ee8e5cf3466cde1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_005/Pos_070111_nillable_005.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db8d089d8aa20ed50376ae9087a6f583f74e3ef0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.1.11, Nillable element of complex type (value option) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// ComplexType XSD elements are mapped to an outer record type or field, according to clause 7.6 . +// When the nillable XSD attribute is allocated to such an element, the element components of the +// complex type shall be enframed by an extra optional TTCN-3 record field. I.e., the attributes +// of the complex-type element, mapped to a field of the outer record, shall not be the members +// of the inner record, generated for the nillable XSD attribute. The name of the inner record +// field shall be the result of applying clause 5.2.2 to the name "content". The outer record, +// corresponding to the complexType component of the nillable element, shall be appended with the +// "useNil" encoding instruction. + +module Pos_070111_nillable_006 { + + import from schema_Pos_070111_nillable_006 language "XSD" all; + + template MyType m_msg := { + bar := 1, + content := omit, + content_1 := { + foo := 25 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070111_nillable_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070111_nillable_006.xml", { "Pos_070111_nillable_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070111_nillable_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1b343711eb8087d0426b418b2018d68d9e182f1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xml @@ -0,0 +1,4 @@ + + + 25 + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3c019cef6ad859baab48077d589f2b90ccff4438 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070111_nillable/Pos_070111_nillable_006/Pos_070111_nillable_006.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neg_070112_use_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neg_070112_use_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d199b0512087a8a5c0ccc198a2f02f95694b744 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neg_070112_use_001.ttcn @@ -0,0 +1,56 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.12, Verify that attribute with required use cannot be omitted + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// If the value of the use attribute is required, the TTCN-3 field corresponding +// to the XSD attribute shall be mandatory (i.e. without optional). + +module Neg_070112_use_001 { + + import from schema_Neg_070112_use_001 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := omit, + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_070112_use_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_070112_use_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neq_070112_use_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neq_070112_use_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2edae896b030595b69c8521a0a1baed58976cf84 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Neg_070112_use_001/Neq_070112_use_001.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06975ed89eed8dc269760ce1f71826f92f625bd7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.12, Verify that attribute with required use is correctly converted + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of the use attribute is required, the TTCN-3 field corresponding +// to the XSD attribute shall be mandatory (i.e. without optional). + +module Pos_070112_use_001 { + + import from schema_Pos_070112_use_001 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := "attr", + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070112_use_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070112_use_001.xml", { "Pos_070112_use_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070112_use_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..1fd7c9c72ae4842b4a444b61071c7b2be9d452b8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4fd86d7fba2716deb45448de91bf57259f2f33d3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_001/Pos_070112_use_001.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f639507ca2f73fabe996e025dc6376ef0719792a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.12, Verify that attribute with optional use is correctly converted + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the use attribute ... value is optional in an XSD attribute declaration, +// the TTCN-3 field resulted by the mapping of the corresponding attribute shall +// be optional. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070112_use_002 { + + import from schema_Pos_070112_use_002 language "XSD" all; + + template MyType m_msg := { + foo := { + attr := omit, + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070112_use_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070112_use_002.xml", { "Pos_070112_use_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070112_use_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..6be4b7049995c75376541f0ce48c84d8209c2bcc --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cdf57ac44de9acd28989fd74ef87b41acfc03339 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_002/Pos_070112_use_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ad5b0744a8391597d937b15bff4d8f58f1cf400 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.12, Verify that attribute with prohibited use is not converted + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// XSD attributes with the value of the use attribute prohibited shall not be +// translated to TTCN-3. + +module Pos_070112_use_003 { + + import from schema_Pos_070112_use_003 language "XSD" all; + + template MyType m_msg := { + foo := { + base := 5 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070112_use_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070112_use_003.xml", { "Pos_070112_use_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070112_use_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..065de3a92752b30f77aec712a611cd3861b735ef --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xml @@ -0,0 +1,4 @@ + + + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e15bd6dc978df448e13f2f24c5821e3e85b778ef --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070112_use/Pos_070112_use_003/Pos_070112_use_003.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.ttcn b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d82d2495f0cb9d958723d61c0ff7a710801807f6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.1.14, Verify conversion of elements with final attribute + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The final XSD attribute information item(s) shall produce no TTCN-3 language +// construct when translating an XML Schema to TTCN-3. + +module Pos_070114_final_001 { + + import from schema_Pos_070114_final_001 language "XSD" all; + + template MyType m_msg := "test"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070114_final_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070114_final_001.xml", { "Pos_070114_final_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070114_final_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xml b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c73369c3db7b3f9410b2ff945012bb2ccd42544d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xml @@ -0,0 +1,2 @@ + +test \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xsd b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b8e22de234c304e32d0e9f1d239afb7eac2d1998 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0701_component_attributes/070114_final/Pos_070114_final_001/Pos_070114_final_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.ttcn b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..27eee93fed712bd36dad361f31e38722a4ae25f8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.3, Verify conversion of global element of simple type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In case of XSD datatypes, and simple types defined locally as child of the +// element, the type of the XSD element mapped to TTCN-3. + +module Pos_0703_element_component_001 { + + import from schema_Pos_0703_element_component_001 language "XSD" all; + + template MyType m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0703_element_component_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0703_element_component_001.xml", { "Pos_0703_element_component_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0703_element_component_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xml b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c8021582efc4aa50d82d6c57981a6ca1c802fd2c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xsd b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..de9eea688ea398958d23c7f96ec98e5f35cde059 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_001/Pos_0703_element_component_001.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.ttcn b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbd600c6502c8fa890518c627541d42cde025153 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.3, Verify conversion of global element of user defined type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In case of XSD user-defined types referenced by the type attribute of the +// element, the TTCN-3 type generated for the referenced XSD type. + +module Pos_0703_element_component_002 { + + import from schema_Pos_0703_element_component_002 language "XSD" all; + + template MyBaseType m_typeBased := 1; + template MyType m_msg := m_typeBased; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0703_element_component_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0703_element_component_002.xml", { "Pos_0703_element_component_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0703_element_component_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xml b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c0e1f17ed7b2d013d68bb793f660263b756381b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xsd b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1b57ff753d6f9c04d4e082adf4685f3fc041bf2e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_002/Pos_0703_element_component_002.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.ttcn b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cbc3cb7f29da4e33b633f3d66ab50846ca04cbdd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.3, Verify conversion of global element of locally defined complex type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In case the child of the element is a locally defined complexType, it shall +// be a TTCN-3 record. + +module Pos_0703_element_component_003 { + + import from schema_Pos_0703_element_component_003 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := "bar" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0703_element_component_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0703_element_component_003.xml", { "Pos_0703_element_component_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0703_element_component_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xml b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c63bed59f3f90ab96d1796f9ad2438d2ac8fe6d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xml @@ -0,0 +1,5 @@ + + + foo + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xsd b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9ae08664f487bae353c79aa11ab32044a39f58d8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_003/Pos_0703_element_component_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.ttcn b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..90ac13de71653cec197ca13d35d70a131a994785 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.3, Verify conversion of local elements defined by reference with different namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When a local element is defined by reference (the ref attribute is used) and +// the target namespace of the XSD Schema in which the referenced element is +// defined differs from the target namespace of the referencing XSD Schema +// (including the no target namespace case), the TTCN-3 field generated for this +// element reference shall be appended with a "namespace as" encoding +// instruction (see clause B.3.1), which shall identify the namespace and +// optionally the prefix of the XSD schema in which the referenced entity is +// defined. + +module Pos_0703_element_component_004 { + + import from schema_Pos_0703_element_component_004 language "XSD" all; + + template MyType m_msg := { + imported := "abc" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0703_element_component_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0703_element_component_004.xml", { "Pos_0703_element_component_004.xsd", "Pos_0703_element_component_004_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0703_element_component_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xml b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..41ce901875c59c05af161a8b768d4bdcb4b8a1b6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xml @@ -0,0 +1,4 @@ + + + abc + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xsd b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..212696df07e46c19c546d237576ef3b16037b7b4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004_1.xsd b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..49bf3b4216ba7d8ea871f692d75e90250dbfe65a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0703_element_component/Pos_0703_element_component_004/Pos_0703_element_component_004_1.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24398d10b106e23910637446baddbfb493d02a65 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.4.1, Verify mapping of a globally defined attribute + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070401_attribute_element_definitions_001 { + + import from schema_Pos_070401_attribute_element_definitions_001 language "XSD" all; + + template E1 m_msg := {a1:="test", elem := "test1234"}; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070401_attribute_element_definitions_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070401_attribute_element_definitions_001.xml", { "Pos_070401_attribute_element_definitions_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070401_attribute_element_definitions_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..df16e1ffde2cccbd8e91d95855546ebaf6ebc05a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml @@ -0,0 +1,6 @@ + + + test1234 + diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3513c2e54b9e0d0680189ef3b28c9015d916ae67 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c930f8da837ea0fd6cdb417f4242582a7a623f3f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.4.2, Verify mapping of a globally defined attribute group + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070402_attribute_group_definitions_001 { + + import from schema_Pos_070402_attribute_group_definitions_001 language "XSD" all; + + template E1 m_msg := { + fgroup := 10.0, + igroup := 10, + sgroup := "text", + elem := "text1234" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070402_attribute_group_definitions_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070402_attribute_group_definitions_001.xml", { "Pos_070402_attribute_group_definitions_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070402_attribute_group_definitions_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..908c8c6725ebc0c3eca8057c72968d7b9e0bf75e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml @@ -0,0 +1,6 @@ + + + text1234 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7b79baf2737ab9ce318731ba20286fc0f6af9486 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_and_attribute_group_definitions/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..24398d10b106e23910637446baddbfb493d02a65 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.4.1, Verify mapping of a globally defined attribute + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070401_attribute_element_definitions_001 { + + import from schema_Pos_070401_attribute_element_definitions_001 language "XSD" all; + + template E1 m_msg := {a1:="test", elem := "test1234"}; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070401_attribute_element_definitions_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070401_attribute_element_definitions_001.xml", { "Pos_070401_attribute_element_definitions_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070401_attribute_element_definitions_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a0804d81f9dd25e23b4830f1d88e8610ec59404 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xml @@ -0,0 +1,6 @@ + + + test1234 + diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3513c2e54b9e0d0680189ef3b28c9015d916ae67 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070401_attribute_element_definitions/Pos_070401_attribute_element_definitions_001/Pos_070401_attribute_element_definitions_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c930f8da837ea0fd6cdb417f4242582a7a623f3f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.4.2, Verify mapping of a globally defined attribute group + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070402_attribute_group_definitions_001 { + + import from schema_Pos_070402_attribute_group_definitions_001 language "XSD" all; + + template E1 m_msg := { + fgroup := 10.0, + igroup := 10, + sgroup := "text", + elem := "text1234" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070402_attribute_group_definitions_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070402_attribute_group_definitions_001.xml", { "Pos_070402_attribute_group_definitions_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070402_attribute_group_definitions_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..cdd95b1bedf40d3c322f588df79a70d920555362 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xml @@ -0,0 +1,6 @@ + + + text1234 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7b79baf2737ab9ce318731ba20286fc0f6af9486 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0704_attribute_defs/070402_attribute_group_definitions/Pos_070402_attribute_group_definitions_001/Pos_070402_attribute_group_definitions_001.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d26edc354fb6b6b7d9c0e33d10547cedfb2df036 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.1, Verify that it is possible to convert anonymous + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// It is also possible in XSD to restrict an anonymous simple type. The translation +// follows the mapping for built-in data types, but instead of using the base +// attribute to identify the type to apply the facet to, the base attribute type +// shall be omitted and the type of the inner, anonymous simpleType shall be used. +module Pos_070501_derivation_by_restriction_001 { + + import from schema_Pos_070501_derivation_by_restriction_001 language "XSD" all; + + template MyType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070501_derivation_by_restriction_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070501_derivation_by_restriction_001.xml", { "Pos_070501_derivation_by_restriction_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070501_derivation_by_restriction_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d723d68f3819a5342431c3daa098c8f933e6a1c0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a515aaf72b48076db69996fdd362cf35bc3808d0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_001/Pos_070501_derivation_by_restriction_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9871ed6099a57baf3e4496290415bbe934fc709 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.1, Verify that it is possible to convert anonymous + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// It is also possible in XSD to restrict an anonymous simple type. The translation +// follows the mapping for built-in data types, but instead of using the base +// attribute to identify the type to apply the facet to, the base attribute type +// shall be omitted and the type of the inner, anonymous simpleType shall be used. +module Pos_070501_derivation_by_restriction_002 { + + import from schema_Pos_070501_derivation_by_restriction_002 language "XSD" all; + + template Elem_simple_restr m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070501_derivation_by_restriction_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070501_derivation_by_restriction_002.xml", { "Pos_070501_derivation_by_restriction_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070501_derivation_by_restriction_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..7a8d165f52f397e18a96eb28c67132c1e4d5e7ef --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xml @@ -0,0 +1,2 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0b898b57cddb109de3072f4e37164e1caaf2e594 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070501_derivation_by_restriction/Pos_070501_derivation_by_restriction_002/Pos_070501_derivation_by_restriction_002.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dfc4852fa35eed46637e1d84b6ca5d6beaa65653 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify length constraint imposed on type derived by list + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// When using any of the supported XSD facets (length, maxLength, minLength) the +// translation shall follow the mapping for built-in list types, with the difference +// that the base type shall be determined by an anonymous inner list item type. +module Neg_070502_derivation_by_list_001 { + + import from schema_Neg_070502_derivation_by_list_001 language "XSD" all; + + template MyType m_msg := { "abcd", "efgh" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Neg_070502_derivation_by_list_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Neg_070502_derivation_by_list_001.xml", { "Neg_070502_derivation_by_list_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Neg_070502_derivation_by_list_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ad8f71120f240e8d5eaba9176f634eaf17863ae1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_001/Neg_070502_derivation_by_list_001.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2e80b00244108b24e25e910c150a2ac6784d762e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify constraint imposed on inner type defined inside XSD list + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// The other XSD facets shall be mapped accordingly (refer to respective 6.1 clauses). +// If no itemType is given, the mapping has to be implemented using the given inner +// type (see clause 7.5.3). +module Neg_070502_derivation_by_list_002 { + + import from schema_Neg_070502_derivation_by_list_002 language "XSD" all; + + template MyType m_msg := { "abcd", "efgh", "ij" }; // "ij" contains only two characters + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Neg_070502_derivation_by_list_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Neg_070502_derivation_by_list_002.xml", { "Neg_070502_derivation_by_list_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Neg_070502_derivation_by_list_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c7d4777ae4702c7bc58bfca25ddfb708894cc80f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Neg_070502_derivation_by_list_002/Neg_070502_derivation_by_list_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c4caef9471f913c2b4c18c622492accb3c9340c8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify that derivation by list is converted to record of + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// XSD list components shall be mapped to the TTCN-3 record of type. In their +// simplest form lists shall be mapped by directly using the listItem attribute +// as the resulting type. +module Pos_070502_derivation_by_list_001 { + + import from schema_Pos_070502_derivation_by_list_001 language "XSD" all; + + template MyType m_msg := { 1.0, 2.0, 3.0 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070502_derivation_by_list_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070502_derivation_by_list_001.xml", { "Pos_070502_derivation_by_list_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070502_derivation_by_list_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe6d7050c427d317f28b74c2052e83316a2e976a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xml @@ -0,0 +1,2 @@ + +1.0 2.0 3.0 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c8db999771d7cad7888e503c2fa64250826ff168 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_001/Pos_070502_derivation_by_list_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4be1c5c6f4fb9350724cd9ad5b2a135ff46314d6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify mapping of facets connected applied to derivation by list + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When using any of the supported XSD facets (length, maxLength, minLength) the +// translation shall follow the mapping for built-in list types, with the difference +// that the base type shall be determined by an anonymous inner list item type. +module Pos_070502_derivation_by_list_002 { + + import from schema_Pos_070502_derivation_by_list_002 language "XSD" all; + + template MyType m_msg := {1.0, 2.0, 3.14 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070502_derivation_by_list_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070502_derivation_by_list_002.xml", { "Pos_070502_derivation_by_list_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070502_derivation_by_list_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..0011230a6cbc7b12b0c2b8f841b980de92b15d05 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xml @@ -0,0 +1,2 @@ + +1.0 2.0 3.14 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b4f72f7f80eae5b52d1bf15dbe0711842a7d87c4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_002/Pos_070502_derivation_by_list_002.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5fd81b946a5385ce4846f04e52487b163f88b033 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify conversion of facets defined inside XSD list + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The other XSD facets shall be mapped accordingly (refer to respective 6.1 clauses). +// If no itemType is given, the mapping has to be implemented using the given inner +// type (see clause 7.5.3). +module Pos_070502_derivation_by_list_003 { + + import from schema_Pos_070502_derivation_by_list_003 language "XSD" all; + + template MyType m_msg := { "abcd", "efgh", "ijkl" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070502_derivation_by_list_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070502_derivation_by_list_003.xml", { "Pos_070502_derivation_by_list_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070502_derivation_by_list_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..c9ed400386b043da350971cbfb6d28c18170ce0d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xml @@ -0,0 +1,2 @@ + +abcd efgh ijkl \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fbb3990b1ee988b98c0c2c8e968877facd26bd87 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_003/Pos_070502_derivation_by_list_003.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..147df97c98662d4762277f44bd337764c9ce2979 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify transformation of derivation by list with enumerated facets inside + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The other XSD facets shall be mapped accordingly (refer to respective 6.1 clauses). +// If no itemType is given, the mapping has to be implemented using the given inner +// type (see clause 7.5.3). +module Pos_070502_derivation_by_list_004 { + + import from schema_Pos_070502_derivation_by_list_004 language "XSD" all; + + template MyType m_msg := { orange, blue }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070502_derivation_by_list_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070502_derivation_by_list_004.xml", { "Pos_070502_derivation_by_list_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070502_derivation_by_list_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..bf72d9252560d3585299c8af94802506c5d9cc1a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xml @@ -0,0 +1,2 @@ + +Orange Blue \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a1d60459140cde01ee259d3db367e9b084790f42 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_004/Pos_070502_derivation_by_list_004.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..68deb265875b2dc53a28e5f93e34d67aa43b3c5b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.2, Verify transformation of list containing union content + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070502_derivation_by_list_005 { + + import from schema_Pos_070502_derivation_by_list_005 language "XSD" all; + + template MyType m_msg := { { alt_ := true }, { alt_1 := 2.0 }, { alt_ := false } }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070502_derivation_by_list_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070502_derivation_by_list_005.xml", { "Pos_070502_derivation_by_list_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070502_derivation_by_list_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..b814a6f5298926c36b2a4e549a1f2c91dd8fa36d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xml @@ -0,0 +1,2 @@ + +true 2.0 false \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..487664fe9dff005fc6051897bcffe8232db8ad2b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070502_derivation_by_list/Pos_070502_derivation_by_list_005/Pos_070502_derivation_by_list_005.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8f957fbe8a20858c1bcd49730019649383acfe02 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:7.5.3, Verify transformation of union with memberTypes attribute + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD union is considered as a set of mutually exclusive alternative types for +// a simpleType. As this is compatible with the union type of TTCN-3, a simpleType +// derived by union in XSD shall be mapped to a union type definition in TTCN-3. The +// generated TTCN-3 union type shall contain one alternative for each member type of +// the XSD union, preserving the textual order of the member types in the initial XSD +// union type. The field names of the TTCN-3 union type shall be the result of applying +// clause 5.2.2 to either to the unqualified name of the member type (in case of built +// in XSD data types and user defined named types) ... . +module Pos_070503_derivation_by_union_001 { + + import from schema_Pos_070503_derivation_by_union_001 language "XSD" all; + + template MyType m_msg := { integer_ := 5 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_001.xml", { "Pos_070503_derivation_by_union_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..2987b08bf9ca963b4f44719bf68c66f0a3f03ddd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7b6aeb1cc52e2e35101e730e3e26b5920ed31719 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_001/Pos_070503_derivation_by_union_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..922cf434a22e9ff3e9d9ddb7a235b2346327b391 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:7.5.3, Verify transformation of union with unnamed member types + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD union is considered as a set of mutually exclusive alternative types for +// a simpleType. As this is compatible with the union type of TTCN-3, a simpleType +// derived by union in XSD shall be mapped to a union type definition in TTCN-3. The +// generated TTCN-3 union type shall contain one alternative for each member type of +// the XSD union, preserving the textual order of the member types in the initial XSD +// union type. The field names of the TTCN-3 union type shall be the result of applying +// clause 5.2.2 ... to the string "alt" (in case of unnamed member types). +module Pos_070503_derivation_by_union_002 { + + import from schema_Pos_070503_derivation_by_union_002 language "XSD" all; + + template MyType m_msg := { alt_ := 1.0 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_002.xml", { "Pos_070503_derivation_by_union_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..b5d1e3cdd576e10a566f000af208c0597461a1bf --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xml @@ -0,0 +1,2 @@ + +1.0 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7ac1c5f53d10750a5c37b4e713a7602d08ace11a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_002/Pos_070503_derivation_by_union_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a3425bcff61b2d8f69f1be3115da2d6af73b18d3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union with memberTypes attribute and unnamed member types + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD union is considered as a set of mutually exclusive alternative types for +// a simpleType. As this is compatible with the union type of TTCN-3, a simpleType +// derived by union in XSD shall be mapped to a union type definition in TTCN-3. The +// generated TTCN-3 union type shall contain one alternative for each member type of +// the XSD union, preserving the textual order of the member types in the initial XSD +// union type. The field names of the TTCN-3 union type shall be the result of applying +// clause 5.2.2 to either to the unqualified name of the member type (in case of built +// in XSD data types and user defined named types) ) or to the string "alt" (in case +// of unnamed member types). +module Pos_070503_derivation_by_union_003 { + + import from schema_Pos_070503_derivation_by_union_003 language "XSD" all; + + template MyType m_msgTest := { time := "14:35:21" }; + template MyType m_msg := { alt_ := "2014-04-24" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_003.xml", { "Pos_070503_derivation_by_union_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..f67ca9815c07c5b2d68b34ad9be221e917722c36 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xml @@ -0,0 +1,2 @@ + +2014-04-24 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7a6b780ef4dd35910863cee19fc3c15787b90efe --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_003/Pos_070503_derivation_by_union_003.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..345f7c3ac8c4a44ff9dd19bb5cfe1b6e1a4029a5 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union with memberTypes attribute and unnamed enumeration + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD union is considered as a set of mutually exclusive alternative types for +// a simpleType. As this is compatible with the union type of TTCN-3, a simpleType +// derived by union in XSD shall be mapped to a union type definition in TTCN-3. The +// generated TTCN-3 union type shall contain one alternative for each member type of +// the XSD union, preserving the textual order of the member types in the initial XSD +// union type. The field names of the TTCN-3 union type shall be the result of applying +// clause 5.2.2 to either to the unqualified name of the member type (in case of built +// in XSD data types and user defined named types) ) or to the string "alt" (in case +// of unnamed member types). +module Pos_070503_derivation_by_union_004 { + + import from schema_Pos_070503_derivation_by_union_004 language "XSD" all; + + template MyType m_msgTest := { nonNegativeInteger := 5 }; + template MyType m_msg := { alt_ := unbounded }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_004.xml", { "Pos_070503_derivation_by_union_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..86602c1888ce3226592a2f530414c70dac75b605 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xml @@ -0,0 +1,2 @@ + +unbounded \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..47c3fbe335a2e4dd5af85e459528fa227664a871 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_004/Pos_070503_derivation_by_union_004.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a4fd544c773363a32efb14bb8e58cb4f4ef6192 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union content containing enumeration facets + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_005 { + + import from schema_Pos_070503_derivation_by_union_005 language "XSD" all; + + template MyType m_msg := { alt_2 := "small" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_005.xml", { "Pos_070503_derivation_by_union_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..75e5fde5e8a87746713869669f0666ccf9700a1a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xml @@ -0,0 +1,2 @@ + +small \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0550355e8b836976777e4399727233da5b994e6a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_005/Pos_070503_derivation_by_union_005.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc53e6ea753a781b9658c1e1a059ac463a6ba670 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union containing list content + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_006 { + + import from schema_Pos_070503_derivation_by_union_006 language "XSD" all; + + template MyType m_msg := { alt_1 := { 1.0, 2.0, 3.0 }}; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_006.xml", { "Pos_070503_derivation_by_union_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..cf583511090b11a3be9650b46ebfbcd01bb290f8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xml @@ -0,0 +1,2 @@ + +1.0 2.0 3.0 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..78ebcab07297bd79cb1bfedea5db35440199d91f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_006/Pos_070503_derivation_by_union_006.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..246bb6b7bddc57ca55b9f3226fd84a843ee5e082 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (anonymous union members) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_007 { + + import from schema_Pos_070503_derivation_by_union_007 language "XSD" all; + + template MyType m_msg := { xsiType := alt_, content := x20 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_007.xml", { "Pos_070503_derivation_by_union_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..bb6efe6121cba36aee20824234159fd4186680a8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xml @@ -0,0 +1,2 @@ + +20 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..56318915a060285e0d002c796d3ec7008b46be58 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_007/Pos_070503_derivation_by_union_007.xsd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..296dcf74391b9adf07616c9720485501c532af04 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.ttcn @@ -0,0 +1,81 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.5.3, Verify transformation of union restricted by enum facets (referenced union members) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +module Pos_070503_derivation_by_union_008 { + + import from schema_Pos_070503_derivation_by_union_008 language "XSD" all; + + template MyType m_msg := { xsiType := integer_, content := x20 }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070503_derivation_by_union_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070503_derivation_by_union_008.xml", { "Pos_070503_derivation_by_union_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070503_derivation_by_union_008(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xml b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xml new file mode 100644 index 0000000000000000000000000000000000000000..cd2d07c7241f3cbab667131d81115320dceb016a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xml @@ -0,0 +1,2 @@ + +20 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xsd b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3fe6dd114c2548361694636761b44561c0c9ccdf --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0705_simpletype_components/070503_derivation_by_union/Pos_070503_derivation_by_union_008/Pos_070503_derivation_by_union_008.xsd @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38cac8c7e0d5dbbee1e4201e54445e137029b812 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.ttcn @@ -0,0 +1,82 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.1.1, Verify extension of a built-in type by adding an attribute + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060101_extending_simple_content_001 { + + import from schema_Pos_07060101_extending_simple_content_001 language "XSD" all; + + template E23el m_msg := {bar := 1, foo := 2.0, base := "something"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060101_extending_simple_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060101_extending_simple_content_001.xml", { "Pos_07060101_extending_simple_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060101_extending_simple_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b8df4f18d8d63d81fe8b5104f00eecccd9bbf39 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xml @@ -0,0 +1,4 @@ + +something diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ec04b694e60e75d09bfad3e7f471ec0583a13642 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_001/Pos_07060101_extending_simple_content_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4efd4e0551f4040667c921cabfaed9d2bd636dd8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.1.1, Verify extension without changing the base creates a synonym type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirement is tested: +// If the definition of a new named or unnamed complex type uses another simple or complex type as the base +// of the extension without changing the base type (i.e. no facet is applied and no attribute is added), it +// shall be translated to a TTCN-3 type synonym to the base type (see clause 6.4 of [1]), completed with +// necessary additional encoding instructions (see section 7.6 rule 1). + +// NOTE: revision required after CR7656 is resolved + +module Pos_07060101_extending_simple_content_002 { + + import from schema_Pos_07060101_extending_simple_content_002 language "XSD" all; + + template Elem_complex_ext_simple m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060101_extending_simple_content_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060101_extending_simple_content_002.xml", { "Pos_07060101_extending_simple_content_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060101_extending_simple_content_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..8780f201d9efc8b83a3ae04354c0031140e63345 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xml @@ -0,0 +1,3 @@ + +1 diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d24ec37b8056ad822d135baf9e688ec139b1093f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060101_extending_simple_content/Pos_07060101_extending_simple_content_002/Pos_07060101_extending_simple_content_002.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0c2c405f289cfa917ba1c2e275ef759187626c9e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.ttcn @@ -0,0 +1,50 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.1.2, Verify restriction of a base type + ** @verdict pass reject + ***************************************************/ +module Neg_07060102_restricting_simple_content_001 { + + import from schema_Neg_07060102_restricting_simple_content_001 language "XSD" all; + + template E1 m_msg := { + bar := 1, + foo := 2.0, + base := "someone" //error because of length 4 + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + + type component C { + port P p; + } + + testcase TC_Neg_07060102_restricting_simple_content_001() runs on C system C { + map(self:p, system:p); + + // encode the message + p.send(m_msg); + log("template should either be rejected by compiler or by runtime latest while encoding"); + + setverdict(fail, "Invalid template should not be encoded"); + + unmap(self:p, system:p); + } + + control { + execute(TC_Neg_07060102_restricting_simple_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b6be7b64154aed0b2df5ba33deef1374f827c724 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Neg_07060102_restricting_simple_content_001/Neg_07060102_restricting_simple_content_001.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..baa63396aa608721a1a01e712c2114fba98cfd93 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.ttcn @@ -0,0 +1,86 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.1.2, Verify restriction of a base type + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060102_restricting_simple_content_001 { + + import from schema_Pos_07060102_restricting_simple_content_001 language "XSD" all; + + /*template E1 m_msg := { + bar := 1, + foo := 2.0, + base := "some" + }*/ + + template E1 m_msg := {bar := 1, foo := 2.0, base := "some"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060102_restricting_simple_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060102_restricting_simple_content_001.xml", { "Pos_07060102_restricting_simple_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060102_restricting_simple_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8bec1b68d1164af515065d92a5a8fb8bcaf1a1b9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xml @@ -0,0 +1,4 @@ + +some \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ee18446086cdc00cfff5cba5b5eaf74392aa07fc --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_001/Pos_07060102_restricting_simple_content_001.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..97f7a5e85db406d4a84391f67df4139a9b725f26 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.1.2, Verify that a synonym type is created for restriction with no base type change + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If the definition of a new named or unnamed complex type uses another simple or complex type as the base of +// the restriction without changing the base type (i.e. no facet is applied), it shall be translated to a TTCN-3 +// type synonym to the base type (see clause 6.4 of [1]), completed with necessary additional encoding +// instructions (see section 7.6 rule 1). + +// NOTE: revision required after CR7656 is resolved + +module Pos_07060102_restricting_simple_content_002 { + + import from schema_Pos_07060102_restricting_simple_content_002 language "XSD" all; + + template Elem_complex_restr_simple m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060102_restricting_simple_content_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060102_restricting_simple_content_002.xml", { "Pos_07060102_restricting_simple_content_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060102_restricting_simple_content_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..e88861011426654394336b2a1d4c65f4287a82b8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xml @@ -0,0 +1,3 @@ + +1 \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b5b032966e1382a0f18baeb15c1133fa358fc1e0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070601_simple_content/07060102_restricting_simple_content/Pos_07060102_restricting_simple_content_002/Pos_07060102_restricting_simple_content_002.xsd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e00578a492c14b9c2d0c2bab2f5fda9422310b13 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.ttcn @@ -0,0 +1,125 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and the + ** extending types have the compositor sequence. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_001 { + + import from schema_Pos_07060201_derived_by_extension_001 language "XSD" all; + //template for EXAMPLE1 and following type system shall be generated from xsd file: + /*type record E1 + { + // fields corresponding to attributes of the base and the extending type + // (in alphabetical order) + XSD.String birthDateAttrGroup optional, + XSD.String birthPlaceAttrGroup optional, + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitOfAge optional, + // followed by fields corresponding to elements of the base type + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase, + // finally fields corresponding to the extending element and group reference + XSD.Integer ageElemExt, + G25seq g25seq + } + with { + variant "name as uncapitalized "; + variant (birthDateAttrGroup, birthPlaceAttrGroup, genderAttrBase, jobPositionAttrGroup,unitOfAge) "attribute"; + }; + + type record G25seq { + XSD.String familyStatusElemInGroup, + XSD.String spouseElemInGroup optional + } + with { + variant "untagged" + }*/ + + template E1 m_msg := { + birthDateAttrGroup := omit, + birthPlaceAttrGroup := omit, + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitOfAge := omit, + titleElemBase := "titleElemBase1", + forenameElemBase := "forenameElemBase2", + surnameElemBase := "surnameElemBase3", + ageElemExt := 1, + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup4", + spouseElemInGroup := omit + } + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_001.xml", { "Pos_07060201_derived_by_extension_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..048b340fd4d70a417876aceb4827977224bde3e8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xml @@ -0,0 +1,10 @@ + + + titleElemBase1 + forenameElemBase2 + surnameElemBase3 + 1 + familyStatusElemInGroup4 + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f05003b5bb2e98c12bae16e89b9502c9baf633d3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_001/Pos_07060201_derived_by_extension_001.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9641773907d8783f0ae528fefcf03cf5837cb37d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.ttcn @@ -0,0 +1,120 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and the + ** extending types have the compositor sequence and multiple occurrences + ** are allowed. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_002 { + + import from schema_Pos_07060201_derived_by_extension_002 language "XSD" all; + // template for EXAMPLE 2: type element e26seqReccurrence and one value of sequence_list + // and following type system shall be generated from xsd file: + /* + type record E1 { + // fields corresponding to attributes of the base and the extending type + // (in alphabetical order) + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitOfAge optional, + // followed by a "simple" field list corresponding to elements of the base type + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase, + // the extending sequence is recurring (see clause 7.6.6.6 for the mapping) + record of record { + G25seq g25seq + XSD.Integer ageElemExt, + } sequence_list + } + with { + variant "name as uncapitalized"; + variant(sequence_list) "untagged"; + variant (genderAttrBase, jobPositionAttrGroup, unitOfAge) "attribute" + + */ + template E1 m_msg := { + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitOfAge := omit, + titleElemBase := "titleElemBase", + forenameElemBase := "forenameElemBase", + surnameElemBase := "surnameElemBase", + sequence_list := {{ + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup", + spouseElemInGroup := omit + }, + ageElemExt := 1 + }} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_002.xml", { "Pos_07060201_derived_by_extension_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..7529cee01fea88288b041a0fe3d79c1cb04ed348 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xml @@ -0,0 +1,9 @@ + + + titleElemBase + forenameElemBase + surnameElemBase + familyStatusElemInGroup + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5f8f94d25a29b1d15400094385cc9f8a54e02bbb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_002/Pos_07060201_derived_by_extension_002.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4368b616c80947f76c3f6a5b0dd89d2731f853c0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.ttcn @@ -0,0 +1,129 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and the + ** extending types have the compositor sequence and multiple occurrences + ** are allowed. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_003 { + + import from schema_Pos_07060201_derived_by_extension_003 language "XSD" all; + // template for EXAMPLE 2: type element e26seqDoubleRecurrence and one value of sequence_list and sequence_list_1 + // and following type system shall be generated from xsd file: + /* + type record E26seqDoubleRecurrence { + // fields corresponding to attributes of the base and the extending type + // (in alphabetical order) + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitOfAge optional, + // followed by a record of record field containing the fields corresponding to elements of + // the base type; the base type is a recurring sequence (see clause + // 7.6.6.6 for the + // mapping) + record of record { + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase + } sequence_list, + // the extending sequence is recurring too(see clause + // 7.6.6.6 for the + // mapping) + record of record { + G25seq g25seq + XSD.Integer ageElemExt, + } sequence_list_1 + } + with { + variant "name as uncapitalized"; + variant(sequence_list, sequence_list_1) "untagged"; + variant (genderAttrBase, jobPositionAttrGroup, unitOfAge) "attribute" + } + */ + template E1 m_msg := { + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitOfAge := omit, + sequence_list := {{ + titleElemBase := "titleElemBase", + forenameElemBase := "forenameElemBase", + surnameElemBase := "surnameElemBase" + }}, + sequence_list_1 := {{ + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup", + spouseElemInGroup := omit + }, + ageElemExt := 1 + }} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_003.xml", { "Pos_07060201_derived_by_extension_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..1eb7c0055894ba6a582403a7ff2940f6492b9fbb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xml @@ -0,0 +1,9 @@ + + + titleElemBase + forenameElemBase + surnameElemBase + familyStatusElemInGroup + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8916eed9f725388caf55429c9d9cc4f0bd226716 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_003/Pos_07060201_derived_by_extension_003.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1aa2a1fc875f5a0e8a52da1c69cb302474afa192 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.ttcn @@ -0,0 +1,130 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and the + ** extending types have the compositor sequence and multiple occurrences + ** are allowed. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_004 { + + import from schema_Pos_07060201_derived_by_extension_004 language "XSD" all; +// template for EXAMPLE 2: type element e26seqReccurrence and two records of sequence_list + // and following type system shall be generated from xsd file: + /* + type record E1 { + // fields corresponding to attributes of the base and the extending type + // (in alphabetical order) + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitOfAge optional, + // followed by a "simple" field list corresponding to elements of the base type + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase, + // the extending sequence is recurring (see clause 7.6.6.6 for the mapping) + record of record { + G25seq g25seq + XSD.Integer ageElemExt, + } sequence_list + } + with { + variant "name as uncapitalized"; + variant(sequence_list) "untagged"; + variant (genderAttrBase, jobPositionAttrGroup, unitOfAge) "attribute" + + */ + + template E1 m_msg := { + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitOfAge := omit, + titleElemBase := "titleElemBase", + forenameElemBase := "forenameElemBase", + surnameElemBase := "surnameElemBase", + sequence_list := { + { + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup", + spouseElemInGroup := omit + }, + ageElemExt := 1 + }, + { + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup2", + spouseElemInGroup := omit + }, + ageElemExt := 2 + } + } + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_004.xml", { "Pos_07060201_derived_by_extension_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..263c2596323366d5b61a142e2ffae088febba0e1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xml @@ -0,0 +1,11 @@ + + + titleElemBase + forenameElemBase + surnameElemBase + familyStatusElemInGroup + 1 + familyStatusElemInGroup2 + 2 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..85eebf8f8131825f39ccb9ace087aa2cd3002d9e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_004/Pos_07060201_derived_by_extension_004.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..06b808a854ed4db980a177a54755491972c7751c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.ttcn @@ -0,0 +1,136 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and the + ** extending types have the compositor sequence and multiple occurrences + ** are allowed. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_005 { + + import from schema_Pos_07060201_derived_by_extension_005 language "XSD" all; + // template for EXAMPLE 2: type element e26seqDoubleRecurrence and two records of sequence_list and one sequence_list_1 + // and following type system shall be generated from xsd file: + /* + type record E26seqDoubleRecurrence { + // fields corresponding to attributes of the base and the extending type + // (in alphabetical order) + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitOfAge optional, + // followed by a record of record field containing the fields corresponding to elements of + // the base type; the base type is a recurring sequence (see clause + // 7.6.6.6 for the + // mapping) + record of record { + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase + } sequence_list, + // the extending sequence is recurring too(see clause + // 7.6.6.6 for the + // mapping) + record of record { + G25seq g25seq + XSD.Integer ageElemExt, + } sequence_list_1 + } + with { + variant "name as uncapitalized"; + variant(sequence_list, sequence_list_1) "untagged"; + variant (genderAttrBase, jobPositionAttrGroup, unitOfAge) "attribute" + } + */ + template E1 m_msg := { + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitOfAge := omit, + sequence_list := { + { + titleElemBase := "titleElemBase", + forenameElemBase := "forenameElemBase", + surnameElemBase := "surnameElemBase" + }, + { + titleElemBase := "titleElemBase1", + forenameElemBase := "forenameElemBase1", + surnameElemBase := "surnameElemBase1" + } + }, + sequence_list_1 := {{ + g25seq :={ + familyStatusElemInGroup :="familyStatusElemInGroup", + spouseElemInGroup := omit + }, + ageElemExt := 1 + }} + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_005.xml", { "Pos_07060201_derived_by_extension_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..0cd95e7cb061ecc1ad622e2f02c4b31c25a778f7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xml @@ -0,0 +1,12 @@ + + + titleElemBase + forenameElemBase + surnameElemBase + titleElemBase1 + forenameElemBase1 + surnameElemBase1 + familyStatusElemInGroup + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..361be2bd78f366936eef5123dd60dd5456950e7c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_005/Pos_07060201_derived_by_extension_005.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a5ada14634f559c78b217191e172f74bd036cd44 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.ttcn @@ -0,0 +1,111 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where both the base and + ** the extending types have the compositor choice + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_006 { + + import from schema_Pos_07060201_derived_by_extension_006 language "XSD" all; + // template for EXAMPLE 3: type element e26cho + // and following type system shall be generated from xsd file: + /* + type record E1 { + XSD.String genderAttrBase optional, + XSD.String unitAttrExt optional, + union { + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase + } choice, + union { + XSD.Integer ageElemExt + XSD.Date birthdayElemExt + } choice_1 + } + with { + variant "name as uncapitalized"; + variant(genderAttrBase, unitAttrExt) "attribute"; + variant(choice, choice_1) "untagged" + } + */ + template E1 m_msg := { + genderAttrBase := omit, + unitAttrExt := omit, + choice := { + surnameElemBase := "surnameElemBase" + }, + choice_1 :={ + ageElemExt := 10 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_006.xml", { "Pos_07060201_derived_by_extension_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..7c1ddd2d3a52c56f93d812a158fac0f44f245de4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xml @@ -0,0 +1,6 @@ + + + surnameElemBase + 10 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..672bbe8dfbf232501db32456fd342aa22fccc338 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_006/Pos_07060201_derived_by_extension_006.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31f89e02ff228b47edc0c16dd1213a3ad7482c14 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.ttcn @@ -0,0 +1,113 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type where extension of a sequence + ** base type by a choice model group + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_007 { + + import from schema_Pos_07060201_derived_by_extension_007 language "XSD" all; + // template for EXAMPLE 4: type element e27cho + // and following type system shall be generated from xsd file: + /* + type record E1 + { + XSD.Integer genderAttrBase optional, + XSD.String jobPositionAttrGroup optional, + XSD.String unitAttrExt optional, + XSD.String titleElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase, + union { + XSD.Integer ageElemExt, + XSD.Date birthdayElemExt + } choice + } + with { + variant "name as uncapitalized"; + variant(genderAttrBase, jobPositionAttrGroup, unitAttrExt) "attribute"; + variant(choice) "untagged" + } + */ + + template E1 m_msg := { + genderAttrBase := omit, + jobPositionAttrGroup := omit, + unitAttrExt := omit, + titleElemBase :="titleElemBase", + forenameElemBase :="forenameElemBase", + surnameElemBase :="surnameElemBase", + choice := { + ageElemExt := 10 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_007.xml", { "Pos_07060201_derived_by_extension_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..62066ba2984eb70405f677440ed3d8dc9226aa94 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xml @@ -0,0 +1,10 @@ + + + titleElemBase + forenameElemBase + surnameElemBase + + 10 + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a796d6e3914ab1b408b73a263b799f04cb086ae8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_007/Pos_07060201_derived_by_extension_007.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..43cf4f84d59e8c54d00760ebcf35782bfc606ae0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.ttcn @@ -0,0 +1,108 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify mapping of complex type: + ** extending of a base type with choice model group by a sequence model group + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_008 { + + import from schema_Pos_07060201_derived_by_extension_008 language "XSD" all; + // template for EXAMPLE 5: type element e27seq + // and following type system shall be generated from xsd file: + /* + type record E1 { + XSD.String genderAttrBase optional, + XSD.String unitAttrExt optional, + union { + XSD.String ElemBase, + XSD.String forenameElemBase, + XSD.String surnameElemBase + } choice, + XSD.Integer ageElemExt + } + with { + variant "name as uncapitalized"; + variant(genderAttrBase, unitAttrExt) "attribute"; + variant(choice) "untagged"; + } + */ + + template E1 m_msg := { + genderAttrBase := "genderAttrBase", + unitAttrExt := omit, + choice := { + surnameElemBase := "surnameElemBase" + }, + ageElemExt := 10 + + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_008.xml", { "Pos_07060201_derived_by_extension_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_008(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xml new file mode 100644 index 0000000000000000000000000000000000000000..55b6d40d634018c51d045abd689405feb0d5bfb7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xml @@ -0,0 +1,10 @@ + + + + surnameElemBase + + + 10 + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xsd new file mode 100644 index 0000000000000000000000000000000000000000..54d7b190ed7c24d6dacc44ce67403871ed42655a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_008/Pos_07060201_derived_by_extension_008.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38c0cee009b436c1f2d82caaae5d616b76c25908 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.ttcn @@ -0,0 +1,101 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:7.6.2.1, Verify mapping of complex type: + ** Recursive extension of an anonymous inner type is realized + ** using the TTCN-3 dot notation (starts from the name of the outmost type) + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060201_derived_by_extension_009 { + + import from schema_Pos_07060201_derived_by_extension_009 language "XSD" all; + // template for EXAMPLE 6: type element X + // and following type system shall be generated from xsd file: + /* + type record E1 { + XSD.String x, + record { + XSD.String x, + E1.y y optional, + XSD.String z + } y optional + } + */ + + template E1 m_msg := { + x := "x", + y := { + x := "x1", + y := omit, + z := "z1" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_009() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_009.xml", { "Pos_07060201_derived_by_extension_009.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_009(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xml new file mode 100644 index 0000000000000000000000000000000000000000..753fb4302b8424e0b9ceaba60841f3532b165ef0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xml @@ -0,0 +1,13 @@ + + + x + + + x1 + + z1 + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xsd new file mode 100644 index 0000000000000000000000000000000000000000..26e0d621b6461d2530d3e807b89ff4f1424cd3d6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_009/Pos_07060201_derived_by_extension_009.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c67f3f7699b8e45cf0899a61a9fb2e977628c204 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.2.1, Verify that a complex content derived by extension with no change is mapped to a synonym type + ** extending types have the compositor sequence. + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If the definition of a new named or unnamed complex type uses another simple or complex type as the base of +// the extension without changing the base type (i.e. no facet is applied and no element or attribute is added), +// it shall be translated to a TTCN-3 type synonym to the base type (see clause 6.4 of [1]), completed with +// necessary additional encoding instructions (see section 7.6 rule 1). + +module Pos_07060201_derived_by_extension_010 { + + import from schema_Pos_07060201_derived_by_extension_010 language "XSD" all; + + template Elem_complex_ext_complex m_msg := { + attr := 23, + int := 1, + str := "xyz" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060201_derived_by_extension_010() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060201_derived_by_extension_010.xml", { "Pos_07060201_derived_by_extension_010.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060201_derived_by_extension_010(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xml new file mode 100644 index 0000000000000000000000000000000000000000..2809cc50d77b6f3384e81c924807fa152499b947 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xml @@ -0,0 +1,8 @@ + + + 1 + xyz + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d539635cdaf9a98d6afc27e8b376f44558856948 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060201_derived_by_extension/Pos_07060201_derived_by_extension_010/Pos_07060201_derived_by_extension_010.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c740bacb00bc4d9ace38810a89febbbcb602d736 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.2.2, Verify mapping of complex content derived by restriction: + ** AnyType is used as the base type and it is restricted to only two elements + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_07060202_derived_by_restriction_001 { + + import from schema_Pos_07060202_derived_by_restriction_001 language "XSD" all; + + template E1 m_msg := { + size := -200, + unit:= "string" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060202_derived_by_restriction_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060202_derived_by_restriction_001.xml", { "Pos_07060202_derived_by_restriction_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060202_derived_by_restriction_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f4733cf28928995b088f2184e1df694b040c457 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xml @@ -0,0 +1,6 @@ + + + -200 + string + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..396e5612ce586bb3131bcf13951f7fd0fdf50674 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_001/Pos_07060202_derived_by_restriction_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..32ceaadb7d60a52fac55535b17105ee39231bfa2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 Verify that a complex content derived by restriction with no change is mapped to a synonym type + ** @purpose 9:7.6.2.2, + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ + +// The following requirements are tested: +// If the definition of a new named or unnamed complex type uses another complex type as the base of +// the restriction without changing the base type (i.e. no facet is present), it shall be translated +// to a TTCN-3 type synonym to the base type (see clause 6.4 of [1]), completed with necessary +// additional encoding instructions (see section 7.6. rule 1). + +module Pos_07060202_derived_by_restriction_002 { + + import from schema_Pos_07060202_derived_by_restriction_002 language "XSD" all; + + template Elem_complex_restr_complex m_msg := {} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060202_derived_by_restriction_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060202_derived_by_restriction_002.xml", { "Pos_07060202_derived_by_restriction_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060202_derived_by_restriction_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..4f5549256571cb2bddcf359fd93e8e60d627a8c3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xml @@ -0,0 +1,3 @@ + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..249809559e5f199d0e7ad5ce23c18fe8db0da3e2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070602_complex_content/07060202_derived_by_restriction/Pos_07060202_derived_by_restriction_002/Pos_07060202_derived_by_restriction_002.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7bdfc555dae452030cae23f7bf94f63a94aa053f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (sequence, one occurrence) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When group reference is a child of complexType, the compositor of the +// referenced group definition is sequence and both the minOccurs and maxOccurs +// attributes of the group reference equal to "1" (either explicitly or by +// defaulting to "1"), it shall be translated as if the child elements of the +// referenced group definition were present in the complexType definition +// directly +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070603_referencing_group_components_001 { + + import from schema_Pos_070603_referencing_group_components_001 language "XSD" all; + + template MyType m_msg := { + shipTo := "New York", + billTo := "SuperMegaCorp Inc." + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_001.xml", { "Pos_070603_referencing_group_components_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..065f7f1f8efa012f1c0f2e37d7411ad142035377 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xml @@ -0,0 +1,5 @@ + + + New York + SuperMegaCorp Inc. + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..05254f38bdf0489dba52f39f73ea11b87fbbf924 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_001/Pos_070603_referencing_group_components_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8b685acb43faaafa91130ed7495fe5c41a352565 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring inside sequence + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_002 { + + import from schema_Pos_070603_referencing_group_components_002 language "XSD" all; + + template MyType m_msg := { + shipAndBill := { + shipTo := "Windsor Castle", + billTo := "Her Majesty" + }, + sentFrom := "Luxury department" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_002.xml", { "Pos_070603_referencing_group_components_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..73d00f1bcfbecbf8b31e782d8821d3fa9fa23f2b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xml @@ -0,0 +1,6 @@ + + + Windsor Castle + Her Majesty + Luxury department + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a3ae310d384be6cc655819168933626f55235bb5 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_002/Pos_070603_referencing_group_components_002.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..255f7f05aac879610a5dd71ace197d98c7a139d4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (sequence, optional occurrence) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_003 { + + import from schema_Pos_070603_referencing_group_components_003 language "XSD" all; + + template MyType m_msg := { + "test", + { + shipTo := "Mars", + billTo := "NASA" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_003.xml", { "Pos_070603_referencing_group_components_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..cbb569b905443b119147eadff74c511c0512899f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xml @@ -0,0 +1,5 @@ + + + Mars + NASA + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a39892505419644e99b2b7116396610972de7d38 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_003/Pos_070603_referencing_group_components_003.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f6284d2bdf29b1026dde17366a048653ceea94ed --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (sequence, 0..N) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_004 { + + import from schema_Pos_070603_referencing_group_components_004 language "XSD" all; + + template MyType m_msg := { + shipAndBill_list := { + { "New York", "SuperMegaCorp Inc."}, + { "Berlin", "SuperMegaGesellschaft AG" } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_004.xml", { "Pos_070603_referencing_group_components_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..77bc8b047554660a3ca16f962b48352dd3d8aaca --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xml @@ -0,0 +1,7 @@ + + + New York + SuperMegaCorp Inc. + Berlin + SuperMegaGesellschaft AG + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a122b06b20d0365c08c09f3205abba7d93785cda --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_004/Pos_070603_referencing_group_components_004.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c029c57eec4ddcd31cbd77fd4fff8c5f8f3eb979 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (all, one occurrence) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When the referenced group has the compositor all, it has to be translated is +// the content of the referenced group definition was present directly, i.e. +// according to clause 7.6.4; + +module Pos_070603_referencing_group_components_005 { + + import from schema_Pos_070603_referencing_group_components_005 language "XSD" all; + + template MyType m_msg := { + { billTo, shipTo }, + omit, + "New York", + "SuperMegaCorp Inc." + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_005.xml", { "Pos_070603_referencing_group_components_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..02f6163555e10e9a847116e86a1638e1d2061965 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xml @@ -0,0 +1,5 @@ + + + SuperMegaCorp Inc. + New York + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5680592eb91e5f2b8593aeef0ecc7f2195a55640 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_005/Pos_070603_referencing_group_components_005.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ad6f5cfb53b81c6e2da1f771100167b8c6ee97fa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (all, 0..1) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When the referenced group has the compositor all, it has to be translated is +// the content of the referenced group definition was present directly, i.e. +// according to clause 7.6.4; + +module Pos_070603_referencing_group_components_006 { + + import from schema_Pos_070603_referencing_group_components_006 language "XSD" all; + template MyType m_msg := { + { }, + omit, + omit, + omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_006.xml", { "Pos_070603_referencing_group_components_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..294bc4d01c0027690116a48acac8012e1d47961e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cf936fabd071764c9646ec31b2a5307a0e4f876d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_006/Pos_070603_referencing_group_components_006.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d69abfb7ae925757851cb64b2355adac8b586c90 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (choice, one occurrence) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_007 { + + import from schema_Pos_070603_referencing_group_components_007 language "XSD" all; + + template MyType m_msg := { + shipAndBill := { shipTo := "Beijing" } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_007() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_007.xml", { "Pos_070603_referencing_group_components_007.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..462c45e84e52e7db933d53d6a999e3f9fedd02d8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xml @@ -0,0 +1,4 @@ + + + Beijing + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a8786d918f959ed0c583d77e653b969381aff99c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_007/Pos_070603_referencing_group_components_007.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b82a6fab27029adc39736158cc487a7efd4a1f69 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (choice, 0..1) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_008 { + + import from schema_Pos_070603_referencing_group_components_008 language "XSD" all; + + template MyType m_empty := { + 1, omit + }; + template MyType m_msg := { + attr := omit, + shipAndBill := { billTo := "Bill the Bull" } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_008() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_008.xml", { "Pos_070603_referencing_group_components_008.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_008(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b5ca0ea5ffa18d5b1ae0a0780fa678c3c02a4ce --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xml @@ -0,0 +1,4 @@ + + + Bill the Bull + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xsd new file mode 100644 index 0000000000000000000000000000000000000000..0301c0f3986d9c67e43e76e6b0a9a5dd7f7bbf7a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_008/Pos_070603_referencing_group_components_008.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..900d9ce8f0b55d55b0027cf3c3d11ab0ab83b75b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring as child of complex type (choice, 0..N) + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_009 { + + import from schema_Pos_070603_referencing_group_components_009 language "XSD" all; + + template MyType m_msg := { + shipAndBill_list := { + { + shipTo := "Mata-Utu" + }, { + billTo := "Tamasia and Malofafa" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_009() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_009.xml", { "Pos_070603_referencing_group_components_009.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_009(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xml new file mode 100644 index 0000000000000000000000000000000000000000..7d11750f71373c0c271cea167131385eb97ed024 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xml @@ -0,0 +1,5 @@ + + + Mata-Utu + Tamasia and Malofafa + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6d4026ade062300f054bfeb19d13dd0510359b7c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_009/Pos_070603_referencing_group_components_009.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d4747870b48ed36bcfde4e72aff4a8b312569ff6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.3, Verify conversion of group reference occurring inside choice + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In all other cases the referenced group component shall be translated to +// a field of the enclosing record of type (generated for the parent +// complexType, sequence or choice element) referencing the TTCN-3 type +// generated for the referenced group definition, considering also the +// attributes of the referenced group component according to clause 7.1. + +module Pos_070603_referencing_group_components_010 { + + import from schema_Pos_070603_referencing_group_components_010 language "XSD" all; + + template MyType m_msg := { + choice := { + shipAndBill := { + shipTo := "Ulan Bator" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070603_referencing_group_components_010() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070603_referencing_group_components_010.xml", { "Pos_070603_referencing_group_components_010.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070603_referencing_group_components_010(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xml new file mode 100644 index 0000000000000000000000000000000000000000..74a306b0db8ea53cb3c3e4764e55bd14399bb32a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xml @@ -0,0 +1,4 @@ + + + Ulan Bator + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4a0ecc1f037e68e071a5c90fbb629cfe9f585429 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070603_referencing_group_components/Pos_070603_referencing_group_components_010/Pos_070603_referencing_group_components_010.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8b25424a44b14cae5b66772499d02297d7e6ca1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.4, Verify conversion of all content containing mandatory fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, when the values of both the minOccurs and maxOccurs +// attributes of the all compositor equal "1" (either explicitly or by +// defaulting to "1"), it shall be translated to TTCN-3 by adding the fields +// resulted by mapping the XSD elements to the enframing TTCN-3 record (see +// clause 7.6). +// In addition, to these fields, an extra first field named "order" shall be +// inserted into the enframing record. The type of this extra field shall be +// record of enumerated, where the names of the enumeration values shall be +// the names of the fields resulted by mapping the elements of the all +// structure. Finally, a "useOrder" variant attribute shall be attached to +// the enframing record. + +module Pos_070604_all_content_001 { + + import from schema_Pos_070604_all_content_001 language "XSD" all; + + template MyType m_msg := { + order := { bar, ding, foo }, + foo := 5, + bar := 3.14, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070604_all_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070604_all_content_001.xml", { "Pos_070604_all_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070604_all_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..6860497126d25ee345f5d600b092133107aca0e9 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xml @@ -0,0 +1,6 @@ + + + 3.14 + ding + 5 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7f426b9372658c20d79da53f9297f559cfb273a7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_001/Pos_070604_all_content_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..813cb95f69f5d683ee2cb0bfd30aa814f2bd0d0c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.4, Verify conversion of all content with minOccurs="0" + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// By setting the minOccurs XSD attribute of the all compositor to 0, all +// elements of the all content model are becoming optional. In this case all +// record fields corresponding to the elements of the all model group shall be +// set to optional too. +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070604_all_content_002 { + + import from schema_Pos_070604_all_content_002 language "XSD" all; + + template MyType m_staticCheck := { + order := {}, + foo := omit, + bar := omit, + ding := omit + }; + template MyType m_msg := { + order := { ding, foo, bar }, + foo := 5, + bar := 3.14, + ding := "test" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070604_all_content_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070604_all_content_002.xml", { "Pos_070604_all_content_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070604_all_content_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..874b63f803036b748b3ca000d0ac0181a19c1e8e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xml @@ -0,0 +1,6 @@ + + + test + 5 + 3.14 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1389449cc4f847502ecf852f44a73154fcb0c56d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_002/Pos_070604_all_content_002.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1a0d8a4cd8f1cecaa3857e99728b52de6c2278d7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.ttcn @@ -0,0 +1,92 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.4, Verify transformation of elements with minOccurs attribute occuring inside all content + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD all compositor shall be translated to TTCN-3 by adding the fields +// resulted by mapping the XSD elements to the enframing TTCN-3 record (see +// clause 7.6). +//////////////////////////////////////////////////////////////////////////////// + +module Pos_070604_all_content_003 { + + import from schema_Pos_070604_all_content_003 language "XSD" all; + + template MyType m_msg := { + order := { ding, foo }, + foo := 71, + bar := omit, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070604_all_content_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070604_all_content_003.xml", { "Pos_070604_all_content_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070604_all_content_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..235c094a182c32819050a89a0b4efd4dfa76fc4b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xml @@ -0,0 +1,5 @@ + + + ding + 71 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e7be6016bf2754f164643846227a121fcab1b219 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_003/Pos_070604_all_content_003.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0862d71ef1a4359b0f49b0fb467913e4333278c7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.4, Verify transformation of all content containing attributes + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The order field shall precede the fields resulted by the translation of the +// attributes and attribute and attributeGroup references of the given +// complexType. + +module Pos_070604_all_content_004 { + + import from schema_Pos_070604_all_content_004 language "XSD" all; + + template MyType m_msg := { + { foo, ding, bar }, + "attrInGroup1", + omit, + 1, + "attrGlobal", + 2, + 3.14, + "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070604_all_content_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070604_all_content_004.xml", { "Pos_070604_all_content_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070604_all_content_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..36fe01b279bc7a3e99e4e0674c697b91e83e4935 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xml @@ -0,0 +1,6 @@ + + + 2 + ding + 3.14 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f131dcdf744abd207b849e7677c3ebbab9730f2c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070604_all_content/Pos_070604_all_content_004/Pos_070604_all_content_004.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0bbcbb517d397cfa7acc795d60c8d1d091d28a92 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.1, Verify that choice content with nested elements is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Nested elements shall be mapped as fields of the enframing TTCN-3 union or +// record of union field(see clause 7.6.5) according to clause 7.3. + +module Pos_07060501_choice_with_nested_elements_001 { + + import from schema_Pos_07060501_choice_with_nested_elements_001 language "XSD" all; + + template MyType m_msg := { + choice := { + foo := 1 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060501_choice_with_nested_elements_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060501_choice_with_nested_elements_001.xml", { "Pos_07060501_choice_with_nested_elements_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060501_choice_with_nested_elements_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..21518c964ba0254fe8e45d17991d0ffd12bd3ed4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a19c8b00174fec0b3d914bc324c16ed44f1ba143 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_choice_with_nested_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0bbcbb517d397cfa7acc795d60c8d1d091d28a92 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.1, Verify that choice content with nested elements is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Nested elements shall be mapped as fields of the enframing TTCN-3 union or +// record of union field(see clause 7.6.5) according to clause 7.3. + +module Pos_07060501_choice_with_nested_elements_001 { + + import from schema_Pos_07060501_choice_with_nested_elements_001 language "XSD" all; + + template MyType m_msg := { + choice := { + foo := 1 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060501_choice_with_nested_elements_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060501_choice_with_nested_elements_001.xml", { "Pos_07060501_choice_with_nested_elements_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060501_choice_with_nested_elements_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..21518c964ba0254fe8e45d17991d0ffd12bd3ed4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a19c8b00174fec0b3d914bc324c16ed44f1ba143 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060501_elements/Pos_07060501_choice_with_nested_elements_001/Pos_07060501_choice_with_nested_elements_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e47c38e05e30c5502274e08663cb69fc87c461c3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.2, Verify that choice content with nested group is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Nested group components shall be mapped along with other content as +// a field of the enframing TTCN-3 union or record of union field (see clause +// 7.6.5). The type of this field shall refer to the TTCN-3 type generated for +// the corresponding group and the name of the field shall be the name of the +// TTCN-3 type with the first character uncapitalized. + +module Pos_07060502_choice_with_nested_group_001 { + + import from schema_Pos_07060502_choice_with_nested_group_001 language "XSD" all; + + template MyType m_msg := { + choice := { + group1 := { + foo := "foo", + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060502_choice_with_nested_group_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060502_choice_with_nested_group_001.xml", { "Pos_07060502_choice_with_nested_group_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060502_choice_with_nested_group_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec048a56106556167d4764d6acdad1a420c8759f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml @@ -0,0 +1,5 @@ + + + foo + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e2ca42f877eed7a3e9eb111e3f12bf28006d8022 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_choice_with_nested_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e47c38e05e30c5502274e08663cb69fc87c461c3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.2, Verify that choice content with nested group is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// Nested group components shall be mapped along with other content as +// a field of the enframing TTCN-3 union or record of union field (see clause +// 7.6.5). The type of this field shall refer to the TTCN-3 type generated for +// the corresponding group and the name of the field shall be the name of the +// TTCN-3 type with the first character uncapitalized. + +module Pos_07060502_choice_with_nested_group_001 { + + import from schema_Pos_07060502_choice_with_nested_group_001 language "XSD" all; + + template MyType m_msg := { + choice := { + group1 := { + foo := "foo", + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060502_choice_with_nested_group_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060502_choice_with_nested_group_001.xml", { "Pos_07060502_choice_with_nested_group_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060502_choice_with_nested_group_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec048a56106556167d4764d6acdad1a420c8759f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xml @@ -0,0 +1,5 @@ + + + foo + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e2ca42f877eed7a3e9eb111e3f12bf28006d8022 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060502_group/Pos_07060502_choice_with_nested_group_001/Pos_07060502_choice_with_nested_group_001.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec8eccd42e594411a26b01bf36ca9b58a44fe6cd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.3, Verify that choice content with nested choice is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD choice nested to a choice shall be translated according to clause +// 7.6.5 + +module Pos_07060503_choice_with_nested_choice_001 { + + import from schema_Pos_07060503_choice_with_nested_choice_001 language "XSD" all; + + template MyType m_msg := { + choice := { + choice_1 := { + foo := 1 + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060503_choice_with_nested_choice_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060503_choice_with_nested_choice_001.xml", { "Pos_07060503_choice_with_nested_choice_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060503_choice_with_nested_choice_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d46748db8e011ccd1c14ad47334306aa1a582c7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ebe6e5a26e07a0ad47f255f856e3665a76a10248 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ec8eccd42e594411a26b01bf36ca9b58a44fe6cd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.3, Verify that choice content with nested choice is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD choice nested to a choice shall be translated according to clause +// 7.6.5 + +module Pos_07060503_choice_with_nested_choice_001 { + + import from schema_Pos_07060503_choice_with_nested_choice_001 language "XSD" all; + + template MyType m_msg := { + choice := { + choice_1 := { + foo := 1 + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060503_choice_with_nested_choice_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060503_choice_with_nested_choice_001.xml", { "Pos_07060503_choice_with_nested_choice_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060503_choice_with_nested_choice_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d46748db8e011ccd1c14ad47334306aa1a582c7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ebe6e5a26e07a0ad47f255f856e3665a76a10248 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060503_choice_with_nested_choice/Pos_07060503_choice_with_nested_choice_001/Pos_07060503_choice_with_nested_choice_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19fc9f54f2b00e2320dc6d12ac0e9e0272d5a402 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.4, Verify that choice content with nested sequence is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD sequence nested to a choice shall be mapped to a TTCN-3 record field +// of the enframing TTCN-3 union or record of union field (see clause 7.6.5), +// according to clause 7.6.6. + +module Pos_07060504_choice_with_nested_sequence_001 { + + import from schema_Pos_07060504_choice_with_nested_sequence_001 language "XSD" all; + + template MyType m_msg := { + choice := { + sequence := { + foo := 1, + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060504_choice_with_nested_sequence_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060504_choice_with_nested_sequence_001.xml", { "Pos_07060504_choice_with_nested_sequence_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060504_choice_with_nested_sequence_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..43c6ec0a805c7edebe902af91413337b80bfe8ad --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e46bf0f151ee3edaa3a2c1d90c706109a2fc9faa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db4fb3b2818d902cdd1c55e87a4c23c3cdcb8006 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.4, Verify that choice content with multiple nested sequences is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD sequence nested to a choice shall be mapped to a TTCN-3 record field +// of the enframing TTCN-3 union or record of union field (see clause 7.6.5), +// according to clause 7.6.6. + +module Pos_07060504_choice_with_nested_sequence_002 { + + import from schema_Pos_07060504_choice_with_nested_sequence_002 language "XSD" all; + + template MyType m_msg := { + choice := { + sequence := { + foo := "abc", + bar := "cde", + ding := "fgh", + foo_1 := "ijk", + bar_1 := "lmn" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060504_choice_with_nested_sequence_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060504_choice_with_nested_sequence_002.xml", { "Pos_07060504_choice_with_nested_sequence_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060504_choice_with_nested_sequence_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..59b8aefddcc225c0fd4b469bcd3725700d3714b6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml @@ -0,0 +1,8 @@ + + + abc + cde + fgh + ijk + lmn + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c9bdeea399cc0dfaf61a08f1739a7e858a741d6e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_choice_with_nested_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19fc9f54f2b00e2320dc6d12ac0e9e0272d5a402 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.4, Verify that choice content with nested sequence is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD sequence nested to a choice shall be mapped to a TTCN-3 record field +// of the enframing TTCN-3 union or record of union field (see clause 7.6.5), +// according to clause 7.6.6. + +module Pos_07060504_choice_with_nested_sequence_001 { + + import from schema_Pos_07060504_choice_with_nested_sequence_001 language "XSD" all; + + template MyType m_msg := { + choice := { + sequence := { + foo := 1, + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060504_choice_with_nested_sequence_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060504_choice_with_nested_sequence_001.xml", { "Pos_07060504_choice_with_nested_sequence_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060504_choice_with_nested_sequence_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..43c6ec0a805c7edebe902af91413337b80bfe8ad --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e46bf0f151ee3edaa3a2c1d90c706109a2fc9faa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_001/Pos_07060504_choice_with_nested_sequence_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db4fb3b2818d902cdd1c55e87a4c23c3cdcb8006 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.4, Verify that choice content with multiple nested sequences is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD sequence nested to a choice shall be mapped to a TTCN-3 record field +// of the enframing TTCN-3 union or record of union field (see clause 7.6.5), +// according to clause 7.6.6. + +module Pos_07060504_choice_with_nested_sequence_002 { + + import from schema_Pos_07060504_choice_with_nested_sequence_002 language "XSD" all; + + template MyType m_msg := { + choice := { + sequence := { + foo := "abc", + bar := "cde", + ding := "fgh", + foo_1 := "ijk", + bar_1 := "lmn" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060504_choice_with_nested_sequence_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060504_choice_with_nested_sequence_002.xml", { "Pos_07060504_choice_with_nested_sequence_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060504_choice_with_nested_sequence_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..59b8aefddcc225c0fd4b469bcd3725700d3714b6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xml @@ -0,0 +1,8 @@ + + + abc + cde + fgh + ijk + lmn + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c9bdeea399cc0dfaf61a08f1739a7e858a741d6e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_002/Pos_07060504_choice_with_nested_sequence_002.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e9f2947b50429c57418300ac2f796d4dd163f2cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.5.4, Verify name transformation of the "sequence" choice field + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD sequence nested to a choice shall be mapped to a TTCN-3 record field +// of the enframing TTCN-3 union or record of union field (see clause 7.6.5), +// according to clause 7.6.6. The name of the record field shall be the +// result of applying clause 5.2.2 to "sequence". + +module Pos_07060504_choice_with_nested_sequence_003 { + + import from schema_Pos_07060504_choice_with_nested_sequence_003 language "XSD" all; + + template MyType m_msg := { + choice := { + sequence_1 := { + foo := 1, + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060504_choice_with_nested_sequence_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060504_choice_with_nested_sequence_003.xml", { "Pos_07060504_choice_with_nested_sequence_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060504_choice_with_nested_sequence_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..e654d4d9458c18a1eca7b4ea24fc61680c78ff56 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..2f7f404e3e59db6af1c4cf98bcb84308b7011d4c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060504_sequence/Pos_07060504_choice_with_nested_sequence_003/Pos_07060504_choice_with_nested_sequence_003.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fd01f8e352ddaee5ef4d4f9558034b5a978f92e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.5, Verify that choice content with nested any is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD any element nested to a choice shall be translated according to +// clause 7.7. + +module Pos_07060505_choice_with_nested_any_001 { + + import from schema_Pos_07060505_choice_with_nested_any_001 language "XSD" all; + + template MyType m_msg := { + choice := { + elem := "abc" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060505_choice_with_nested_any_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060505_choice_with_nested_any_001.xml", { "Pos_07060505_choice_with_nested_any_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060505_choice_with_nested_any_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..2dbfc2bbee4cd6e9dc63670341378ae05fd69891 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5df688f028096abdc1bf64c25192f0a18cf606ec --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6fd01f8e352ddaee5ef4d4f9558034b5a978f92e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5.5, Verify that choice content with nested any is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD any element nested to a choice shall be translated according to +// clause 7.7. + +module Pos_07060505_choice_with_nested_any_001 { + + import from schema_Pos_07060505_choice_with_nested_any_001 language "XSD" all; + + template MyType m_msg := { + choice := { + elem := "abc" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060505_choice_with_nested_any_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060505_choice_with_nested_any_001.xml", { "Pos_07060505_choice_with_nested_any_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060505_choice_with_nested_any_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..2dbfc2bbee4cd6e9dc63670341378ae05fd69891 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xml @@ -0,0 +1,2 @@ + +abc \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5df688f028096abdc1bf64c25192f0a18cf606ec --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/07060505_choice_with_nested_any/Pos_07060505_choice_with_nested_any_001/Pos_07060505_choice_with_nested_any_001.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b855f09cd721cb1ce3828620499e8de35811942 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5, Verify that choice content with minOccurs different than 1 is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of the minOccurs or the maxOccurs attributes or both differ +// from "1", the following rules shall apply: +// a) The union field shall be generated as above (including attaching the +// "untagged" encoding instruction). +// b) The procedures in clause 7.1.4 shall be called for the union field. +// NOTE: As the result of applying clause 7.1.4, the type of the field may be +// changed to record of union and in parallel the name of the field may be +// changed to "choice_list". +// c) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and subsequently the field shall be added to the enframing TTCN-3 record +// type (see clause 7.6) or record or union field corresponding to the parent +// of the mapped choice compositor. + +module Pos_070605_top_level_001 { + + import from schema_Pos_070605_top_level_001 language "XSD" all; + + template MyType m_msg := { + choice := { + foo := 1 + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070605_top_level_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070605_top_level_001.xml", { "Pos_070605_top_level_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070605_top_level_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..b83916bd8561a638f75b47a9949fab8822c26253 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xml @@ -0,0 +1,4 @@ + + + 1 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..58db3bc9c56ae43941edcec7d5c30ebe12ecf51c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_001/Pos_070605_top_level_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..209590a92764817722cb0a4160e15f07e1c156d3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.ttcn @@ -0,0 +1,103 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.5, Verify that choice content with maxOccurs larger than 1 is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// If the value of the minOccurs or the maxOccurs attributes or both differ +// from "1", the following rules shall apply: +// a) The union field shall be generated as above (including attaching the +// "untagged" encoding instruction). +// b) The procedures in clause 7.1.4 shall be called for the union field. +// NOTE: As the result of applying clause 7.1.4, the type of the field may be +// changed to record of union and in parallel the name of the field may be +// changed to "choice_list". +// c) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and subsequently the field shall be added to the enframing TTCN-3 record +// type (see clause 7.6) or record or union field corresponding to the parent +// of the mapped choice compositor. + +module Pos_070605_top_level_002 { + + import from schema_Pos_070605_top_level_002 language "XSD" all; + + template MyType m_msg := { + choice_list := { + { + foo := 1 + }, { + bar := "bar" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070605_top_level_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070605_top_level_002.xml", { "Pos_070605_top_level_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070605_top_level_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..b576a6eec97cbfead493b7c0ea530712d007ecc2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ce22ef3c8de167548ccac36f34c6272ec7784b37 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070605_choice_content/070605_top_level/Pos_070605_top_level_002/Pos_070605_top_level_002.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57974059c19f44c82797b0827f9b4613a9a9637d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.1, Verify that sequence content with nested elements is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, child elements of a sequence, which is a child of +// a complexType, shall be mapped to TTCN-3 as fields of the enframing record +// (see clause 7.6) (i.e. the sequence itself is not producing any TTCN-3 +// construct). + +module Pos_07060601_sequence_with_nested_element_001 { + + import from schema_Pos_07060601_sequence_with_nested_element_001 language "XSD" all; + + template MyType m_msg := { + foo := 1, + bar := "bar" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060601_sequence_with_nested_element_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060601_sequence_with_nested_element_001.xml", { "Pos_07060601_sequence_with_nested_element_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060601_sequence_with_nested_element_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c48f91e46dc9cff35e7e42780fa0ad4a4ee0261 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ae44bdad64ee84fd4f620db8c94ea5456be881ec --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..57974059c19f44c82797b0827f9b4613a9a9637d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.1, Verify that sequence content with nested elements is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, child elements of a sequence, which is a child of +// a complexType, shall be mapped to TTCN-3 as fields of the enframing record +// (see clause 7.6) (i.e. the sequence itself is not producing any TTCN-3 +// construct). + +module Pos_07060601_sequence_with_nested_element_001 { + + import from schema_Pos_07060601_sequence_with_nested_element_001 language "XSD" all; + + template MyType m_msg := { + foo := 1, + bar := "bar" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060601_sequence_with_nested_element_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060601_sequence_with_nested_element_001.xml", { "Pos_07060601_sequence_with_nested_element_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060601_sequence_with_nested_element_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c48f91e46dc9cff35e7e42780fa0ad4a4ee0261 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xml @@ -0,0 +1,5 @@ + + + 1 + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ae44bdad64ee84fd4f620db8c94ea5456be881ec --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060601_sequence_with_nested_element/Pos_07060601_sequence_with_nested_element_001/Pos_07060601_sequence_with_nested_element_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1bf20eee203a04378825a09b901371e12bb5c6e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.2, Verify that sequence content with group reference is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, nested group reference components shall be mapped +// to a field of the enframing record type (see clause 7.6) or field. The +// type of the field shall be the TTCN-3 type generated for the referenced +// group and the name of the field shall be the result of applying clause +// 5.2.2 to the name of the referenced group. + +module Pos_07060602_sequence_with_nested_group_001 { + + import from schema_Pos_07060602_sequence_with_nested_group_001 language "XSD" all; + + template MyType m_msg := { + group1 := { + foo := "foo" + }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060602_sequence_with_nested_group_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060602_sequence_with_nested_group_001.xml", { "Pos_07060602_sequence_with_nested_group_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060602_sequence_with_nested_group_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c22219ceddac9d7b37e5ea7316238cbf27fc625b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml @@ -0,0 +1,5 @@ + + + foo + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6380d0a95514d1e533180f1cb9a5d1c302b2ad7b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c1bf20eee203a04378825a09b901371e12bb5c6e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.2, Verify that sequence content with group reference is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, nested group reference components shall be mapped +// to a field of the enframing record type (see clause 7.6) or field. The +// type of the field shall be the TTCN-3 type generated for the referenced +// group and the name of the field shall be the result of applying clause +// 5.2.2 to the name of the referenced group. + +module Pos_07060602_sequence_with_nested_group_001 { + + import from schema_Pos_07060602_sequence_with_nested_group_001 language "XSD" all; + + template MyType m_msg := { + group1 := { + foo := "foo" + }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060602_sequence_with_nested_group_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060602_sequence_with_nested_group_001.xml", { "Pos_07060602_sequence_with_nested_group_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060602_sequence_with_nested_group_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..c22219ceddac9d7b37e5ea7316238cbf27fc625b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xml @@ -0,0 +1,5 @@ + + + foo + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6380d0a95514d1e533180f1cb9a5d1c302b2ad7b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060602_sequence_with_nested_group/Pos_07060602_sequence_with_nested_group_001/Pos_07060602_sequence_with_nested_group_001.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1edef4014608dc585ec363caff26a9d4de96fb30 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.3, Verify that sequence content with nested choice is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD choice nested to a sequence shall be mapped as a field of the +// enframing record (see clauses 7.6, 7.6.5.4 and 7.6.6.4), according to clause +// 7.6.5 (i.e. the sequence itself is not producing any TTCN-3 construct). + +module Pos_07060603_sequence_with_nested_choice_001 { + + import from schema_Pos_07060603_sequence_with_nested_choice_001 language "XSD" all; + + template MyType m_msg := { + choice := { foo := "foo" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060603_sequence_with_nested_choice_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060603_sequence_with_nested_choice_001.xml", { "Pos_07060603_sequence_with_nested_choice_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060603_sequence_with_nested_choice_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d72c5bd21234922bf67a6257ea65db5a6127e24 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml @@ -0,0 +1,5 @@ + + + foo + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cafa00983a4cffab89144e078c7c85d99c4b4aac --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1edef4014608dc585ec363caff26a9d4de96fb30 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.3, Verify that sequence content with nested choice is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD choice nested to a sequence shall be mapped as a field of the +// enframing record (see clauses 7.6, 7.6.5.4 and 7.6.6.4), according to clause +// 7.6.5 (i.e. the sequence itself is not producing any TTCN-3 construct). + +module Pos_07060603_sequence_with_nested_choice_001 { + + import from schema_Pos_07060603_sequence_with_nested_choice_001 language "XSD" all; + + template MyType m_msg := { + choice := { foo := "foo" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060603_sequence_with_nested_choice_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060603_sequence_with_nested_choice_001.xml", { "Pos_07060603_sequence_with_nested_choice_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060603_sequence_with_nested_choice_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..0d72c5bd21234922bf67a6257ea65db5a6127e24 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xml @@ -0,0 +1,5 @@ + + + foo + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cafa00983a4cffab89144e078c7c85d99c4b4aac --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060603_sequence_with_nested_choice/Pos_07060603_sequence_with_nested_choice_001/Pos_07060603_sequence_with_nested_choice_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a719958bb4647f47e60fdfc42084032e97eae023 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.4, Verify that sequence content with sequence is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, a sequence nested in a sequence shall be translated to +// TTCN-3 according to clause 7.6.6 and the resulted constructs shall be added +// to the enframing record type or field (see also clauses 7.6 and 7.6.5.4). + +module Pos_07060604_sequence_with_nested_sequence_001 { + + import from schema_Pos_07060604_sequence_with_nested_sequence_001 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := "bar", + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060604_sequence_with_nested_sequence_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060604_sequence_with_nested_sequence_001.xml", { "Pos_07060604_sequence_with_nested_sequence_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060604_sequence_with_nested_sequence_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..59856a9e5ae37df16ec091ddec07d4bf9a524fa6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml @@ -0,0 +1,6 @@ + + + foo + bar + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9378a8513931e62dbf12f7b3e0eb0c8714f5d72c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17cb8eeba16eb7439c68470c7a6b566ec70812df --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.4, Verify that sequence content with various nested particles is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, a sequence nested in a sequence shall be translated to +// TTCN-3 according to clause 7.6.6 and the resulted constructs shall be added +// to the enframing record type or field (see also clauses 7.6 and 7.6.5.4). + +module Pos_07060604_sequence_with_nested_sequence_002 { + + import from schema_Pos_07060604_sequence_with_nested_sequence_002 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := "bar", + choice := { bar := "bar" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060604_sequence_with_nested_sequence_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060604_sequence_with_nested_sequence_002.xml", { "Pos_07060604_sequence_with_nested_sequence_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060604_sequence_with_nested_sequence_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a3f178fa81dfdb37e5e655196cbf557c2cbdfcd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml @@ -0,0 +1,7 @@ + + + foo + bar + bar + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c33d6cd2bacffc8aa16930852eeb1220e8a2e2a6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a719958bb4647f47e60fdfc42084032e97eae023 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.4, Verify that sequence content with sequence is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, a sequence nested in a sequence shall be translated to +// TTCN-3 according to clause 7.6.6 and the resulted constructs shall be added +// to the enframing record type or field (see also clauses 7.6 and 7.6.5.4). + +module Pos_07060604_sequence_with_nested_sequence_001 { + + import from schema_Pos_07060604_sequence_with_nested_sequence_001 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := "bar", + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060604_sequence_with_nested_sequence_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060604_sequence_with_nested_sequence_001.xml", { "Pos_07060604_sequence_with_nested_sequence_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060604_sequence_with_nested_sequence_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..59856a9e5ae37df16ec091ddec07d4bf9a524fa6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xml @@ -0,0 +1,6 @@ + + + foo + bar + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9378a8513931e62dbf12f7b3e0eb0c8714f5d72c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_001/Pos_07060604_sequence_with_nested_sequence_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..17cb8eeba16eb7439c68470c7a6b566ec70812df --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.4, Verify that sequence content with various nested particles is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the general case, a sequence nested in a sequence shall be translated to +// TTCN-3 according to clause 7.6.6 and the resulted constructs shall be added +// to the enframing record type or field (see also clauses 7.6 and 7.6.5.4). + +module Pos_07060604_sequence_with_nested_sequence_002 { + + import from schema_Pos_07060604_sequence_with_nested_sequence_002 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + bar := "bar", + choice := { bar := "bar" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060604_sequence_with_nested_sequence_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060604_sequence_with_nested_sequence_002.xml", { "Pos_07060604_sequence_with_nested_sequence_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060604_sequence_with_nested_sequence_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..5a3f178fa81dfdb37e5e655196cbf557c2cbdfcd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xml @@ -0,0 +1,7 @@ + + + foo + bar + bar + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c33d6cd2bacffc8aa16930852eeb1220e8a2e2a6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060604_sequence_with_nested_sequence/Pos_07060604_sequence_with_nested_sequence_002/Pos_07060604_sequence_with_nested_sequence_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39a940390cd68b715957a63f4e87fc30bd15091e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.5, Verify that sequence content with nested any content is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD any element nested in a sequence shall be translated according to +// clause 7.7. + +module Pos_07060605_sequence_with_nested_any_content_001 { + + import from schema_Pos_07060605_sequence_with_nested_any_content_001 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + elem := "abc" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060605_sequence_with_nested_any_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060605_sequence_with_nested_any_content_001.xml", { "Pos_07060605_sequence_with_nested_any_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060605_sequence_with_nested_any_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a591b388b0160391bff5b560ca7abaa347f939f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml @@ -0,0 +1,3 @@ + + + fooabc \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7d4d1a41749b2a22d09c98332c1be32c015a1c2c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_any/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..39a940390cd68b715957a63f4e87fc30bd15091e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.5, Verify that sequence content with nested any content is correctly transformed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// An XSD any element nested in a sequence shall be translated according to +// clause 7.7. + +module Pos_07060605_sequence_with_nested_any_content_001 { + + import from schema_Pos_07060605_sequence_with_nested_any_content_001 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + elem := "abc" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060605_sequence_with_nested_any_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060605_sequence_with_nested_any_content_001.xml", { "Pos_07060605_sequence_with_nested_any_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060605_sequence_with_nested_any_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a591b388b0160391bff5b560ca7abaa347f939f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xml @@ -0,0 +1,3 @@ + + + fooabc \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7d4d1a41749b2a22d09c98332c1be32c015a1c2c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060605_sequence_with_nested_any_content/Pos_07060605_sequence_with_nested_any_content_001/Pos_07060605_sequence_with_nested_any_content_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b4fb1e94f8f5443ae9649ce65e55f7f1d537e82 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn @@ -0,0 +1,100 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that sequences with minOccurs=0 are correctly converted to optional fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_001 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001 language "XSD" all; + + template MyType m_msg := { + sequence := { + foo := "foo", + bar := "bar" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..6cc9ed6b5b2f99e1a08405f350081ccf3a22d026 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml @@ -0,0 +1,5 @@ + + + foo + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f7f63456a2f1e6ef5c033cf5d9e461f73bf57791 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a91769960feee36043d9ce08bc0921e39a1e05db --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that nested sequences are correctly converted to optional fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_002 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002 language "XSD" all; + + template MyType m_msg := { + sequence := omit, + choice := { foo1 := "foo1" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..4040c99faa2310ef80cb0e82c6b376c3f57500a0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml @@ -0,0 +1,5 @@ + + + foo1 + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1055e2f33995376e6d3900c434acb985a7798c91 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85f05deec2033dce496fd2e16668925123a44377 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn @@ -0,0 +1,105 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that sequences with minOccurs=unbounded are correctly converted to record of fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_003 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003 language "XSD" all; + + template MyType m_msg := { + sequence_list := { + { + foo := "foo1", + bar := "bar1" + }, { + foo := "foo2", + bar := "bar2" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..619ac8da29ab3c2b858733d1a18fb1eeea46431f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml @@ -0,0 +1,7 @@ + + + foo1 + bar1 + foo2 + bar2 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7cc3d8710559b3d647ba1670c419e485eac93e59 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6341bfa9faed45cc736d30c227f73e80d65fabc8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn @@ -0,0 +1,106 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that nested sequences are correctly converted to record of fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_004 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004 language "XSD" all; + + template MyType m_msg := { + sequence_list := { + { + foo := "foo1", + bar := "bar1" + }, { + foo := "foo2", + bar := "bar2" + } + }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..f61f975707471e3995a99b5d96e23446dc72f311 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml @@ -0,0 +1,8 @@ + + + foo1 + bar1 + foo2 + bar2 + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6b8b43f80cd55a31528276212aaba525720c96da --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_effect_of_minoccurs_and_maxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b4fb1e94f8f5443ae9649ce65e55f7f1d537e82 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.ttcn @@ -0,0 +1,100 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that sequences with minOccurs=0 are correctly converted to optional fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_001 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001 language "XSD" all; + + template MyType m_msg := { + sequence := { + foo := "foo", + bar := "bar" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..6cc9ed6b5b2f99e1a08405f350081ccf3a22d026 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xml @@ -0,0 +1,5 @@ + + + foo + bar + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..f7f63456a2f1e6ef5c033cf5d9e461f73bf57791 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001/Pos_07060606_effect_of_minoccurs_and_maxoccurs_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a91769960feee36043d9ce08bc0921e39a1e05db --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.ttcn @@ -0,0 +1,99 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that nested sequences are correctly converted to optional fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_002 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002 language "XSD" all; + + template MyType m_msg := { + sequence := omit, + choice := { foo1 := "foo1" }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..4040c99faa2310ef80cb0e82c6b376c3f57500a0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xml @@ -0,0 +1,5 @@ + + + foo1 + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1055e2f33995376e6d3900c434acb985a7798c91 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002/Pos_07060606_effect_of_minoccurs_and_maxoccurs_002.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85f05deec2033dce496fd2e16668925123a44377 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.ttcn @@ -0,0 +1,105 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that sequences with minOccurs=unbounded are correctly converted to record of fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_003 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003 language "XSD" all; + + template MyType m_msg := { + sequence_list := { + { + foo := "foo1", + bar := "bar1" + }, { + foo := "foo2", + bar := "bar2" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..619ac8da29ab3c2b858733d1a18fb1eeea46431f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xml @@ -0,0 +1,7 @@ + + + foo1 + bar1 + foo2 + bar2 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7cc3d8710559b3d647ba1670c419e485eac93e59 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003/Pos_07060606_effect_of_minoccurs_and_maxoccurs_003.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6341bfa9faed45cc736d30c227f73e80d65fabc8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.ttcn @@ -0,0 +1,106 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that nested sequences are correctly converted to record of fields + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_004 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004 language "XSD" all; + + template MyType m_msg := { + sequence_list := { + { + foo := "foo1", + bar := "bar1" + }, { + foo := "foo2", + bar := "bar2" + } + }, + ding := "ding" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..f61f975707471e3995a99b5d96e23446dc72f311 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xml @@ -0,0 +1,8 @@ + + + foo1 + bar1 + foo2 + bar2 + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6b8b43f80cd55a31528276212aaba525720c96da --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004/Pos_07060606_effect_of_minoccurs_and_maxoccurs_004.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8ff2015e40ce2a6733096088ee86e0e17cd235a6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.ttcn @@ -0,0 +1,107 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.6.6, Verify that a wrapping optional record is decoded as omit if none of fields contained in it is present + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When either or both the minOccurs and/or the maxOccurs attributes of the +// sequence compositor specify a different value than "1", the following rules +// shall apply: +// a) First, the sequence compositor shall be mapped to a TTCN-3 record field +// (as opposed to ignoring it in the previous clauses, when both minOccurs and +// maxOccurs equal to 1) with the name "sequence". +// b) The encoding instruction "untagged" shall be attached to the field +// corresponding to sequence. +// c) The procedures in clause 7.1.4 shall be applied to this record field. +// d) Finally, clause 5.2.2 shall be applied to the name of the resulted field +// and the field shall be added to the enframing TTCN-3 record (see clauses 7.6 +// and 7.6.6) or union field (see clause 7.6.5). + +module Pos_07060606_effect_of_minoccurs_and_maxoccurs_005 { + + import from schema_Pos_07060606_effect_of_minoccurs_and_maxoccurs_005 language "XSD" all; + + template Optionals_in_optional m_msg := { + sequence := { + elem1 := omit, + elem2 := omit, + elem3 := omit, + elem4 := omit, + elem5 := omit + } + }; + + template Optionals_in_optional m_rcv := { + sequence := omit + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xml", { "Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_rcv) { // The value has been changed by the encoder or decoder (in a predictable way) + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_07060606_effect_of_minoccurs_and_maxoccurs_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..08fa0033acce89b227e94b87bf0a3d27f93994e3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xml @@ -0,0 +1,2 @@ + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6168075da223604491c25941a10bf1ca97be01fd --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070606_sequence_content/07060606_minmaxoccurs/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005/Pos_07060606_effect_of_minoccurs_and_maxoccurs_005.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7244dea0db039d1cdecd371e1340e2a81eded47f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.ttcn @@ -0,0 +1,80 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.7, Verify referencing an attributeGroup in a complexType + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001 { + + import from schema_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001 language "XSD" all; + + template E1 m_msg := {bar:=5.0, foo:=omit, ding:="text"}; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xml", { "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..154aa5339660890164aee9164c961aff2f010276 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xml @@ -0,0 +1,6 @@ + + +text + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c906793958e2470d3577b3baff7f94b5191f79b3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__001/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c09fa13c8dd37c82dd43bdaf234b3e000dd78c6a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.7, Verify mapping of a local attributes, attribute references and attribute group references without a target namespace + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002 { + + import from NoTargetNamespace language "XSD" all + with { + extension "File:../Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xsd"; + }; + + template E1 m_msg := { + barInAgroup := "text", + barLocal := omit, + dingInAgroup := 1, + dingLocal := omit, + fooInAgroup := omit, + fooLocal := omit, + barGlobal := omit, + dingGlobal := omit, + fooGlobal := omit, + elem := "text" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xml", { "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..5db9f7de8cdc83c92e3a235d82e94f39b3bd6ce0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xml @@ -0,0 +1,6 @@ + + + text + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cb8fbf81ff3fc72b6d42fa1b43b47e0b0a555d36 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__002/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_002.xsd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1c04ea8e1f646822ddf53a1888ca1d064abb7734 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.7, Verify mapping of a local attributes, attribute references and attribute group references with a target namespace + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003 { + + import from schema_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003 language "XSD" all; + + template E1 m_msg := { + barInAgroup := "text", + barLocal := "text1", + dingInAgroup := 1, + dingLocal := 2, + fooInAgroup := 1.0, + fooLocal := 2.0, + barGlobal := "text2", + dingGlobal := 1, + fooGlobal := 3.0, + elem := "text1234" + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xml", { "Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ce39d5edc19f6731e9461a8117b872a265d775d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xml @@ -0,0 +1,6 @@ + + +text1234 + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fc692c22875ede1e16bb57d92cbb94318101cd2d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070607_attribute/Pos_070607_attribute__003/Pos_070607_attribute_definitions_attribute_and_attributegroup_references_003.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa407aac87fa4e1fe5f0fe8d1fa6abffb99167c3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.6.8, Verify that an error is generated if there are too many items in the embed_values field + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// In TTCN-3 values the number of components of the embed_values field (the number +// of strings to be inserted) shall not exceed the total number of components +// present in the enclosing enframing record, corresponding to the child element +// elements of the complexType with the mixed="true" attribute, i.e. ignoring fields +// corresponding to attribute elements, the embed_values field itself and the order +// field, if present (see clause 7.6.4), plus 1 (i.e. all components of enclosed +// record of-s). + +module Neg_070608_mixed_content_001 { + + import from schema_Neg_070608_mixed_content_001 language "XSD" all; + + template MyType m_msg := { + embed_values:= { "Arrival status. ", "Wait for further information." }, + order := {}, + a:= omit, + b:= omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Neg_070608_mixed_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Neg_070608_mixed_content_001.xml", { "Neg_070608_mixed_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Neg_070608_mixed_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..608e2c52826e8dc390c2d28c5d469eb060a69281 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xml @@ -0,0 +1,2 @@ + +Arrival status. Wait for further information. \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..daa210519c5cb3219d411c73fced112e7dc63c52 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Neg_070608_mixed_content_005/Neg_070608_mixed_content_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cbd32a553a6924015f32b179f53ac23c2011646 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.8, Verify transformation of complex type with sequence constructor and mixed content type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When mixed content is allowed for a complex type or content, (i.e. the mixed +// attribute is set to "true") an additional record of XSD.String field, with +// the field name "embed_values" shall be generated and inserted as the first +// field of the outer enframing TTCN-3 record type generated for the sequence +// content. +// The embed_values field shall precede all other fields, resulted by the +// translation of the attributes and attribute and attributeGroup references of +// the given complexType. + +module Pos_070608_mixed_content_001 { + + import from schema_Pos_070608_mixed_content_001 language "XSD" all; + + template MyType m_msg := { + embed_values:= {"The ordered ", " has arrived ", "Wait for further information."}, + attrib := omit, + a:= "car", + b:= true + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070608_mixed_content_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070608_mixed_content_001.xml", { "Pos_070608_mixed_content_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070608_mixed_content_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..65320c0b8748fc4c9a2d5b6ef489e5b44d51df64 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xml @@ -0,0 +1,2 @@ + +The ordered car has arrived trueWait for further information. \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..52d00d3043237e411ef33ec818ecfb69bada0dcb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_001/Pos_070608_mixed_content_001.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e21ce9a5c658a349631c90f1cd59c0ddb6d0a6cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.8, Verify transformation of omplex type definition with sequence constructor of multiple occurrences and mixed content type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When mixed content is allowed for a complex type or content, (i.e. the mixed +// attribute is set to "true") an additional record of XSD.String field, with +// the field name "embed_values" shall be generated and inserted as the first +// field of the outer enframing TTCN-3 record type generated for the sequence +// content. +// The embed_values field shall precede all other fields, resulted by the +// translation of the attributes and attribute and attributeGroup references of +// the given complexType. + +module Pos_070608_mixed_content_002 { + + import from schema_Pos_070608_mixed_content_002 language "XSD" all; + + template MyType m_msg := { + embed_values := { "The ordered", "has arrived", + "the ordered", "has arrived!", "Wait for further information."}, + sequence_list := { + { a:= "car", b:= false}, + { a:= "bicycle", b:= true} + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070608_mixed_content_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070608_mixed_content_002.xml", { "Pos_070608_mixed_content_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070608_mixed_content_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..03674dd94d181192f42b71915610e7b4439c7b8d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xml @@ -0,0 +1,2 @@ + +The orderedcarhas arrivedfalsethe orderedbicyclehas arrived!trueWait for further information. \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d6ef1b104c7c76bf6723cf0566ed60772702fcf6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_002/Pos_070608_mixed_content_002.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c814f32fb7cb08ed7a42801c3181481898d5fa87 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.8, Verify transformation of complex type definition with all constructor and mixed content type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When mixed content is allowed for a complex type or content, (i.e. the mixed +// attribute is set to "true") an additional record of XSD.String field, with +// the field name "embed_values" shall be generated and inserted as the first +// field of the outer enframing TTCN-3 record type generated for the all +// content. +// The embed_values field shall precede all other fields, resulted by the +// translation of the attributes and attribute and attributeGroup references of +// the given complexType and the order field, if any, generated for the all +// content models. + +module Pos_070608_mixed_content_003 { + + import from schema_Pos_070608_mixed_content_003 language "XSD" all; + + template MyType m_msg := { + {"Arrival status", "product name","Wait for further information."}, + {b,a}, + omit, + "car", + false + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070608_mixed_content_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070608_mixed_content_003.xml", { "Pos_070608_mixed_content_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070608_mixed_content_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..3bbe21c62b6113f5be29dd90530a513ce23a8cc7 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xml @@ -0,0 +1,2 @@ + +Arrival statusfalseproduct namecarWait for further information. \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b6f090606726f18d26cc7ba1871b31b8e4664e1e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_003/Pos_070608_mixed_content_003.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..000c601ee796bd68ade45142d2bfc432a48261e2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @version 0.0.2 + ** @purpose 9:7.6.8, Verify transformation of complex type definition with all constructor, optional elements and mixed content type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// When mixed content is allowed for a complex type or content, (i.e. the mixed +// attribute is set to "true") an additional record of XSD.String field, with +// the field name "embed_values" shall be generated and inserted as the first +// field of the outer enframing TTCN-3 record type generated for the all +// content. +// The embed_values field shall precede all other fields, resulted by the +// translation of the attributes and attribute and attributeGroup references of +// the given complexType and the order field, if any, generated for the all +// content models. + +module Pos_070608_mixed_content_004 { + + import from schema_Pos_070608_mixed_content_004 language "XSD" all; + + template MyType m_msg := { + embed_values:= { "Arrival status" }, + order := {}, + a:= omit, + b:= omit + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070608_mixed_content_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070608_mixed_content_004.xml", { "Pos_070608_mixed_content_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070608_mixed_content_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..1e411eec587b51105d8fb60c60356ad67d463fd6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xml @@ -0,0 +1,2 @@ + +Arrival status \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9a3649aa2a084800c7a1fd1850302f0ef4dcc067 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_004/Pos_070608_mixed_content_004.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.ttcn b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a5ef13152c489394ff69d201f5cb0a413f197aa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.ttcn @@ -0,0 +1,95 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.6.8, Verify transformation of complex type definition with all constructor, optional elements and mixed content type + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The following requirements are tested: +// When mixed content is allowed for a complex type or content, (i.e. the mixed +// attribute is set to "true") an additional record of XSD.String field, with +// the field name "embed_values" shall be generated and inserted as the first +// field of the outer enframing TTCN-3 record type generated for the choice +// content. +// The embed_values field shall precede all other fields, resulted by the +// translation of the attributes and attribute and attributeGroup references of +// the given complexType. + +module Pos_070608_mixed_content_005 { + + import from schema_Pos_070608_mixed_content_005 language "XSD" all; + + template MyComplexElem_14 m_msg := { + embed_values:= {"Arrival status", "Wait for further information."}, + choice := { b:= false } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070608_mixed_content_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070608_mixed_content_005.xml", { "Pos_070608_mixed_content_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070608_mixed_content_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xml b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..29466375d204201f785a7ec15b7d2743664d27ae --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xml @@ -0,0 +1,2 @@ + +Arrival statusfalseWait for further information. \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xsd b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9c339ce1fa0482d19c00bea9e79ffe6c16ebf4c0 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0706_complextype_components/070608_mixed_content/Pos_070608_mixed_content_005/Pos_070608_mixed_content_005.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..80bb08e941753c2164bb161ec139971baa80e30d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element without namespace attribute + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_001 { + + import from schema_Pos_070701_the_any_element_001 language "XSD" all; + + template MyType m_msg := { + elem := "Hello world" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_001.xml", { "Pos_070701_the_any_element_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..cad9e67f9cf864fbbda36e6dd4041484234a6316 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xml @@ -0,0 +1,2 @@ + +Hello world \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a2d6d31034234348d0b82240e94295331389d639 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_001/Pos_070701_the_any_element_001.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fd9a8d9d5a0b0572e5caddc05d2021e8038581cf --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element with ##any namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_002 { + + import from schema_Pos_070701_the_any_element_002 language "XSD" all; + + template MyType m_msg := { + elem := "Hello world" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_002.xml", { "Pos_070701_the_any_element_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..3aff46cf64453b3351bf6953073b76511d14ad9a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xml @@ -0,0 +1,2 @@ + +Hello world \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4c46de3002a33348c533a3528b28da83c33936fe --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_002/Pos_070701_the_any_element_002.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4a0a0a54309851404d9e9c4a8311fb3cd6707818 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element with ##local namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_003 { + + import from schema_Pos_070701_the_any_element_003 language "XSD" all; + + template MyType m_msg := { + elem := "Hello world" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_003.xml", { "Pos_070701_the_any_element_003.xsd", "Pos_070701_the_any_element_003_01_xsd.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..ad9280597eea64025704378de6252b571166fba2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xml @@ -0,0 +1,2 @@ + +Hello world \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a3bc1da15bf4a4a6e1ef6500459cf2af9cf67e7a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003_01_xsd.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003_01_xsd.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c38931739c8d372e63fcac18014910589c33edd4 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_003/Pos_070701_the_any_element_003_01_xsd.xsd @@ -0,0 +1,4 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d05ac6d55a48043ba1d0da38d2ee4a689de600c --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element with ##other namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_004 { + + import from schema_Pos_070701_the_any_element_004 language "XSD" all; + + template MyType m_msg := { + elem := "Hello world" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_004.xml", { "Pos_070701_the_any_element_004.xsd", "Pos_070701_the_any_element_004_1.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..5cec3747bbf6d7de7ca26f5710a6d59bf5e44406 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xml @@ -0,0 +1,2 @@ + +Hello world \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ac7ee329da4db2d64d073f95f1df6f7cd6ade647 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004_1.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004_1.xsd new file mode 100644 index 0000000000000000000000000000000000000000..e2242cb12646a67f316aaba7a40905bce2503434 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_004/Pos_070701_the_any_element_004_1.xsd @@ -0,0 +1,6 @@ + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f0a75c31e3a56bdd7fdb71a2ee224558b830cd12 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element with ##targetNamespace namespace + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_005 { + + import from schema_Pos_070701_the_any_element_005 language "XSD" all; + + template MyType m_msg := { + elem := "Hello world" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_005.xml", { "Pos_070701_the_any_element_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..f85f78edd2f2101626044e6efc58d45d3485c257 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xml @@ -0,0 +1,2 @@ + +Hello world \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d6b44eff6539fc0b97ab17f6889c4fb1fb28478d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_005/Pos_070701_the_any_element_005.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..02fcccd4e4247c03b749dcd7e38ba057fab51e39 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element with URL as namespace into record of + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD any element shall be translated, like other elements, to a field of +// the enframing record type or field or union field (see clauses 7.6, 7.6.5 and +// 7.6.6). The type of this field shall be XSD.String and the name of the field +// shall be the result of applying clause 5.2.2 to "elem". Finally the +// "anyElement..." encoding instruction shall be attached, which shall also +// specify the namespace wildcards and/or list of namespaces which are allowed +// or restricted to qualify the given element, in accordance with the namespace +// attribute of the XSD any element, if present (see details in clause B.3.2). + +module Pos_070701_the_any_element_006 { + + import from schema_Pos_070701_the_any_element_006 language "XSD" all; + + template MyType m_msg := { + elem_list := { + "banana", + "orange", + "parsley" + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070701_the_any_element_006() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070701_the_any_element_006.xml", { "Pos_070701_the_any_element_006.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..961847a754abcb2ef9158e05157e77c8de5c1bd2 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xml @@ -0,0 +1,6 @@ + + +banana +orange +parsley + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c43be3c213d8e4f340a15376cc3c4554d5c1e4a3 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_006/Pos_070701_the_any_element_006.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a053887c6674e9a6c6310222e926a0f6e8b0a2dc --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.7.1, Verify conversion of the any element to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_070701_the_any_element_007 { + + import from schema_Pos_070701_the_any_element_007 language "XSD" all; + + template MyType m_msg := { elem := { Test := "abc" } }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_070701_the_any_element_007() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070701_the_any_element_007(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xml new file mode 100644 index 0000000000000000000000000000000000000000..97af58f8777e6569e9742a249773475f3de299fa --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xml @@ -0,0 +1,4 @@ + + + abc + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9a2416f27dc0fea70ea1b2c1131d76b332b48c0a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070701_the_any_element/Pos_070701_the_any_element_007/Pos_070701_the_any_element_007.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..91834e63dd5a856d173f4d9a4c5485e691f0f431 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.ttcn @@ -0,0 +1,93 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify conversion of anyAttribute element + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The anyAttribute element shall be translated, like other attributes, to +// a field of the enframing record type or field or union field (see clauses +// 7.6, 7.6.5 and 7.6.6). The type of this field shall be record length +// (1..infinity) of XSD.String. + +module Pos_070702_the_anyattribute_element_001 { + + import from schema_Pos_070702_the_anyattribute_element_001 language "XSD" all; + + template MyType m_msg := { + attr := { + "schema:Pos_070702_the_anyattribute_element_001 bar=""bar""", + "schema:Pos_070702_the_anyattribute_element_001 foo=""foo""" + }, + base := "Hello world!" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070702_the_anyattribute_element_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070702_the_anyattribute_element_001.xml", { "Pos_070702_the_anyattribute_element_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d7fe5074316ef74a02306df2580a65a836de9889 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xml @@ -0,0 +1,2 @@ + +Hello world! \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..677e051ef8daebd47076e3b98e1c229582b1936b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_001/Pos_070702_the_anyattribute_element_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..83f660759ca5ef6d4fea422fc328f9263a3c2a95 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.ttcn @@ -0,0 +1,89 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify that anyAttribute is converted into optional field + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The anyAttribute element shall be translated, like other attributes, to +// a field of the enframing record type or field or union field (see clauses +// 7.6, 7.6.5 and 7.6.6). ... The field shall always be optional. + +module Pos_070702_the_anyattribute_element_002 { + + import from schema_Pos_070702_the_anyattribute_element_002 language "XSD" all; + + template MyType m_msg := { + foo := "foo", + attr := omit, + base := "Hello world!" + }; + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070702_the_anyattribute_element_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070702_the_anyattribute_element_002.xml", { "Pos_070702_the_anyattribute_element_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..06faf33bc9a1e31cd1af47ee0fc2180a5c1cfc4e --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xml @@ -0,0 +1,2 @@ + +Hello world! \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..027fd300cd6a3de06ebe7ac69a06971bdacb340a --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_002/Pos_070702_the_anyattribute_element_002.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5f4e6b60ec005f96b8ec03180195ebc875ab9d79 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify that the naming rules apply to converted anyAttribute field + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The name of the field shall be the result of applying clause 5.2.2 to "attr". + +module Pos_070702_the_anyattribute_element_003 { + + import from schema_Pos_070702_the_anyattribute_element_003 language "XSD" all; + + template MyType m_msg := { + attr := "test", + attr_1 := { + "schema:Pos_070702_the_anyattribute_element_003 bar=""bar""", + "schema:Pos_070702_the_anyattribute_element_003 foo=""foo""" + }, + base := "Hello world!" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070702_the_anyattribute_element_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070702_the_anyattribute_element_003.xml", { "Pos_070702_the_anyattribute_element_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..372975b15dcab2b2b8746163a6f7945f9d1dfb62 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xml @@ -0,0 +1,2 @@ + +Hello world! \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..1e865af2f7a89eb0c40767dcb610db5fd27c20cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_003/Pos_070702_the_anyattribute_element_003.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b9cf2ec8d734ac0fcc169c3eaf5e3efd4468ab57 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.ttcn @@ -0,0 +1,96 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify that conversion of anyAttribute present both in extended type and extension base + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// In the case an XSD component contains more than one anyAttribute elements +// (e.g. by a complex type extending an another complex type already containing +// an anyAttribute), only one new field shall be generated for all the +// anyAttribute elements (with the name resulted from applying clause 5.2.2 to +// "attr") but the namespace specifications of all anyAttribute components shall +// be considered in the "anyAttributes" encoding instruction (see below). + +module Pos_070702_the_anyattribute_element_004 { + + import from schema_Pos_070702_the_anyattribute_element_004 language "XSD" all; + + template MyType m_msg := { + ding := "ding", + attr := { + "schema:Pos_070702_the_anyattribute_element_004 bar=""bar""", + "schema:Pos_070702_the_anyattribute_element_004 foo=""foo""" + }, + field := "Hello world!" + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070702_the_anyattribute_element_004() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070702_the_anyattribute_element_004.xml", { "Pos_070702_the_anyattribute_element_004.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_004(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xml new file mode 100644 index 0000000000000000000000000000000000000000..aed204bf73e9bfeba7a99b9a5550692f7480d15b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xml @@ -0,0 +1,4 @@ + + + Hello world! + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xsd new file mode 100644 index 0000000000000000000000000000000000000000..b778155276619b01eeab0a73fa86cbf2be4827df --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_004/Pos_070702_the_anyattribute_element_004.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1cfb8a1b9543f7feafd4a5255687a5c213b3f0c6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.ttcn @@ -0,0 +1,87 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify that converted anyAttribute field is in correct place + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The field shall be inserted directly after the fields generated for the XSD +// attribute elements of the same component or, if the component does not +// contain an attribute component, in the place where the first field generated +// for an XSD attribute would be inserted (see clause 7.6.7). + +module Pos_070702_the_anyattribute_element_005 { + + import from schema_Pos_070702_the_anyattribute_element_005 language "XSD" all; + + template MyType m_msg := { "bar", { "schema:Pos_070702_the_anyattribute_element_005 foo=""foo""" }, "ding" } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_070702_the_anyattribute_element_005() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_070702_the_anyattribute_element_005.xml", { "Pos_070702_the_anyattribute_element_005.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_005(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc1f765ba4fe7464c811f552dd343491407c8352 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xml @@ -0,0 +1,4 @@ + + + ding + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c179c633fd555858b9c618caa8830f3d123006c1 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_005/Pos_070702_the_anyattribute_element_005.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e121a43e7838e782f09cfe3bf2ef69c5d33a19f8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.ttcn @@ -0,0 +1,63 @@ +/*************************************************** + ** @author STF 548 + ** @version 0.0.1 + ** @purpose 9:7.7.2, Verify conversion of anyAttribute element to TTCN-3 anytype + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration any_to_anytype +***************************************************/ + +module Pos_070702_the_anyattribute_element_006 { + + import from schema_Pos_070702_the_anyattribute_element_006 language "XSD" all; + + template MyType m_msg := { attr := { {Bar := "bar"}, { Foo := "foo" } }, base := "Hello world!" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Pos_070702_the_anyattribute_element_006() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_070702_the_anyattribute_element_006(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xml b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xml new file mode 100644 index 0000000000000000000000000000000000000000..9d88fc01e94bf0d25025c03c4e6eb6c3196638df --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xml @@ -0,0 +1,2 @@ + +Hello world! \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xsd b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4a0db05a546db7e8b51751db1841885108fe9f04 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0707_any_and_anyattribute/070702_the_anyattribute_element/Pos_070702_the_anyattribute_element_006/Pos_070702_the_anyattribute_element_006.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.ttcn b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe15831deb46e22993387fc636742f6ae88b0fd8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.ttcn @@ -0,0 +1,85 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.8, Verify that XSD annotation can be processed + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// +//////////////////////////////////////////////////////////////////////////////// + +module Pos_0708_annotation_001 { + + import from schema_Pos_0708_annotation_001 language "XSD" all; + + template MyType m_msg := "test"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0708_annotation_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0708_annotation_001.xml", { "Pos_0708_annotation_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0708_annotation_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xml b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..361fb0680385486db566bd0644359c9c00e9a353 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xml @@ -0,0 +1,2 @@ + +test \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xsd b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..fe4d6b6c0bb9cc24c80fa05534add3371076a5eb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0708_annotation/Pos_0708_annotation_001/Pos_0708_annotation_001.xsd @@ -0,0 +1,10 @@ + + + + Note + This is a helping note! + + + diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.ttcn b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fb7ca67dd1ca3447a006068e42c986fe3229ceeb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.ttcn @@ -0,0 +1,94 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.9, Verify conversion of group definition with sequence compositor + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// [XSD group definition with a sequence compositor] shall be mapped to TTCN-3 +// type definitions the same way as their child components would be mapped +// inside a complexType with one difference: the "untagged" encoding instruction +// shall be attached to the generated TTCN-3 component, corresponding to the +// group element. + +module Pos_0709_group_components_001 { + + import from schema_Pos_0709_group_components_001 language "XSD" all; + + template ShipAndBill m_groupContent := { + shipTo := "New York", + billTo := "SuperMegaCorp Inc." + } + template MyType m_msg := { + shipAndBill_list := { m_groupContent } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0709_group_components_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0709_group_components_001.xml", { "Pos_0709_group_components_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0709_group_components_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xml b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..d42454a226ee2fd9becae9df20e696d2f792f047 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xml @@ -0,0 +1,5 @@ + + + New York + SuperMegaCorp Inc. + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xsd b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..c5a837886c4aed9c74639d62d8d0ddb56220a07d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_001/Pos_0709_group_components_001.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.ttcn b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eabab3bd7fc05e76a702208652ebfe3c8cc9c4bc --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.ttcn @@ -0,0 +1,91 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.9, Verify transformation of group definition with sequence compositor + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// [XSD group definition with a choice compositor] shall be mapped to TTCN-3 +// type definitions the same way as their child components would be mapped +// inside a complexType with one difference: the "untagged" encoding instruction +// shall be attached to the generated TTCN-3 component, corresponding to the +// group element. + +module Pos_0709_group_components_002 { + + import from schema_Pos_0709_group_components_002 language "XSD" all; + + template ShipOrBill m_shipOrBill := { shipTo := "New York" }; + template MyType m_msg := { + shipOrBill_list := { m_shipOrBill } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0709_group_components_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0709_group_components_002.xml", { "Pos_0709_group_components_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0709_group_components_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xml b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f9bf7e50e1dc2fc40db82001dc3751e722a1756f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xml @@ -0,0 +1,4 @@ + + + New York + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xsd b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..621b5508787b564c9a5bb29aa86478395bae4eb8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_002/Pos_0709_group_components_002.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.ttcn b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1b409a83dd2cc56596c95251eb3cdcea1c1d4d63 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.ttcn @@ -0,0 +1,97 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.9, Verify conversion of group definition with all compositor + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// [XSD group definition with an all compositor] shall be mapped to TTCN-3 +// type definitions the same way as their child components would be mapped +// inside a complexType with one difference: the "untagged" encoding instruction +// shall be attached to the generated TTCN-3 component, corresponding to the +// group element. + +module Pos_0709_group_components_003 { + + import from schema_Pos_0709_group_components_003 language "XSD" all; + + template ShipAndBill m_groupContent := { + order := { billTo, shipTo }, + shipTo := "New York", + billTo := "SuperMegaCorp Inc." + } + template MyType m_msg := { + order := { billTo, shipTo }, + shipTo := m_groupContent.shipTo, + billTo := m_groupContent.billTo + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0709_group_components_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0709_group_components_003.xml", { "Pos_0709_group_components_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0709_group_components_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xml b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d89c7590d5015c8f9c631b0a37e19b504bf148f --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xml @@ -0,0 +1,5 @@ + + + SuperMegaCorp Inc. + New York + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xsd b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9df0f59f8758c5d424dfa7f935e355a38b72b23b --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0709_group_components/Pos_0709_group_components_003/Pos_0709_group_components_003.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.ttcn b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..31acccb8bc001918845ef9647a50faf5d61ffb83 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.10, Verify that unique elements (and nested selector and field) are ignored during conversion + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD unique element enables to indicate that some XSD attribute or element +// values shall be unique within a certain scope. As TTCN-3 does not allow +// a similar relational value constraint, mapping of the unique, key and keyref +// elements are not supported by the present document, i.e. these elements shall +// be ignored in the translation process. + +module Pos_0710_identity_constraint_definition_schema_components_001 { + + import from schema_Pos_0710_identity_constraint_definition_schema_components_001 language "XSD" all; + + template MyType m_msg := { + unitInventory_list := { + { + item_list := { { 1004 }, { 1005 }, { 6028 }, { 7450 } }, + unitId := 24 + }, { + item_list := { { 1011 }, { 1042 }, { 5301 }, { 6001 } }, + unitId := 30 + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0710_identity_constraint_definition_schema_components_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0710_identity_constraint_definition_schema_components_001.xml", { "Pos_0710_identity_constraint_definition_schema_components_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0710_identity_constraint_definition_schema_components_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xml b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..3b549626bdb21087ec3833463046d0940e282ed8 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xsd b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9ddfefaf85e0f8bb8cf33bbe7087776d52a995a6 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_001/Pos_0710_identity_constraint_definition_schema_components_001.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.ttcn b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9375c99219155dafd2681848d1856ca5dc5691c5 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.ttcn @@ -0,0 +1,98 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.10, Verify that key elements (and nested selector and field) are ignored during conversion + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD unique element enables to indicate that some XSD attribute or element +// values shall be unique within a certain scope. As TTCN-3 does not allow +// a similar relational value constraint, mapping of the unique, key and keyref +// elements are not supported by the present document, i.e. these elements shall +// be ignored in the translation process. + +module Pos_0710_identity_constraint_definition_schema_components_002 { + + import from schema_Pos_0710_identity_constraint_definition_schema_components_002 language "XSD" all; + + template MyType m_msg := { + unitInventory_list := { + { + item_list := { { 1004 }, { 1005 }, { 6028 }, { 7450 } }, + unitId := 24 + }, { + item_list := { { 1011 }, { 1042 }, { 5301 }, { 6001 } }, + unitId := 24 + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0710_identity_constraint_definition_schema_components_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0710_identity_constraint_definition_schema_components_002.xml", { "Pos_0710_identity_constraint_definition_schema_components_002.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0710_identity_constraint_definition_schema_components_002(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xml b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..81066567d9f6bbb8494c59e929a2aeef625f2380 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xsd b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4bd20d5251d2106f95c50d549a95570694e3db32 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_002/Pos_0710_identity_constraint_definition_schema_components_002.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.ttcn b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a57a1c6d10294227c904605749abbc629dcae9cb --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.ttcn @@ -0,0 +1,107 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:7.10, Verify that keyRef elements (and nested selector and field) are ignored during conversion + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The XSD unique element enables to indicate that some XSD attribute or element +// values shall be unique within a certain scope. As TTCN-3 does not allow +// a similar relational value constraint, mapping of the unique, key and keyref +// elements are not supported by the present document, i.e. these elements shall +// be ignored in the translation process. + +module Pos_0710_identity_constraint_definition_schema_components_003 { + + import from schema_Pos_0710_identity_constraint_definition_schema_components_003 language "XSD" all; + + template MyType m_msg := { + unitInventory_list := { + { + item_list := { { 1004 }, { 1005 }, { 6028 }, { 7450 } }, + unitRef := 24 + }, { + item_list := { { 1011 }, { 1042 }, { 5301 }, { 6001 } }, + unitRef := 30 + } + }, + unitDesc_list := { + { + unitId := 24, + desc := "crucial unit" + }, { + unitId := 30, + desc := "very important unit" + } + } + }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_0710_identity_constraint_definition_schema_components_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_0710_identity_constraint_definition_schema_components_003.xml", { "Pos_0710_identity_constraint_definition_schema_components_003.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_0710_identity_constraint_definition_schema_components_003(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xml b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..4a7964711c922063207f364f7eae8a773058fc3d --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + crucial unit + + + very important unit + + \ No newline at end of file diff --git a/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xsd b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..d13f34e9c86638452c2a799da269df3479480358 --- /dev/null +++ b/ATS/xml/07_mapping_xsd_components/0710_identity/Pos_0710_identity_constraint_definition_schema_components_003/Pos_0710_identity_constraint_definition_schema_components_003.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.ttcn b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2a438aa7f367660253ec3e7170ece806456bc1ed --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.ttcn @@ -0,0 +1,88 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.1 + ** @purpose 9:8.1.1, Generic substitution group example + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration elem_subst + ***************************************************/ +module Pos_080101_head_elements_of_substitution_groups_001 { + + import from schema_Pos_080101_head_elements_of_substitution_groups_001 language "XSD" all; + + template Ize m_msg := { + head_list := { + { head := "anything" }, + { member1 := "any thing" }, + { member2 := something }, + { member3 := { bar:= 5, foo := omit, base := "anything else" } } + } + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_080101_head_elements_of_substitution_groups_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_080101_head_elements_of_substitution_groups_001.xml", { "Pos_080101_head_elements_of_substitution_groups_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_080101_head_elements_of_substitution_groups_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xml b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..5cb8fc38498246e2a8bd177a8ea8204754e46dbd --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xml @@ -0,0 +1,4 @@ + + anything +any thing something anything else + \ No newline at end of file diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xsd b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a4a41fb190a3481d42fdcf6d31b66b9f0f6dc43d --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_001/Pos_080101_head_elements_of_substitution_groups_001.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.ttcn b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9f9f5743858d9a2196c4284d58a9658b32b0af23 --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.ttcn @@ -0,0 +1,84 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:8.1.1, Show effect of the block and abstract attributes on element substitution + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration elem_subst + ***************************************************/ + +// The test is focused on encoding only. Decoding cannot be used as abstract and block attributes prevent it. + +module Pos_080101_head_elements_of_substitution_groups_002 { + + import from schema_Pos_080101_head_elements_of_substitution_groups_002 language "XSD" all; + + template Ize m_msg := { + head_list := { + { head := "anything" }, + { member1 := "any thing" }, + { member2 := something }, + { member3 := { bar:= 5, foo := omit, base := "anything else" } } + } + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_080101_head_elements_of_substitution_groups_002() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.receive(Raw:?) -> value v_rcv { + log("XML message ", v_rcv); + // TODO: in order to enable the check, a validation tool update needed so that it can work without schemas + //if (matchFile(v_rcv, "Pos_080101_head_elements_of_substitution_groups_002.xml", {}, v_matchError)) { + setverdict(pass, "Decoded value matches reference XML"); + //} else { + // setverdict(fail, v_matchError); + //} + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_080101_head_elements_of_substitution_groups_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xml b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xml new file mode 100644 index 0000000000000000000000000000000000000000..f5ee406a6a3155ac3a8af28f4e01e60a24abdc00 --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xml @@ -0,0 +1,10 @@ + + + +anything + any thing + +something + akarmi +anything else + \ No newline at end of file diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xsd b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xsd new file mode 100644 index 0000000000000000000000000000000000000000..3bc55b9a0388d83be5806a0b94df496125de2a5f --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_002/Pos_080101_head_elements_of_substitution_groups_002.xsd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.ttcn b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..04986ffad4bb02a4f83327326fa21fd78046bc33 --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.ttcn @@ -0,0 +1,83 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:8.1.1, Blocking substitution + ** @verdict pass accept, ttcn3verdict:pass + ** @configuration elem_subst + ***************************************************/ + +// The test is focused on encoding only. Decoding cannot be used as abstract and block attributes prevent it. + +module Pos_080101_head_elements_of_substitution_groups_003 { + + import from schema_Pos_080101_head_elements_of_substitution_groups_003 language "XSD" all; + + template Ize m_msg := { + headNoSubstition_list:= { + { headNoSubstition := "anything" }, + { groupMember1 := "any thing" }, + { groupMember2 := "something" } + } + } + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_080101_head_elements_of_substitution_groups_003() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.receive(Raw:?) -> value v_rcv { + log("XML message ", v_rcv); + // TODO: in order to enable the check, a validation tool update needed so that it can work without schemas + //if (matchFile(v_rcv, "Pos_080101_head_elements_of_substitution_groups_003.xml", {}, v_matchError)) { + setverdict(pass, "Decoded value matches reference XML"); + //} else { + // setverdict(fail, v_matchError); + //} + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_080101_head_elements_of_substitution_groups_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xml b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f0404a945050e60cc592e9afcbd0ac6ff4731d1 --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xml @@ -0,0 +1,8 @@ + + + anything + +any thing + +something + \ No newline at end of file diff --git a/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xsd b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xsd new file mode 100644 index 0000000000000000000000000000000000000000..9daba42f429d2567d22fdae2cbc8174abbcfb425 --- /dev/null +++ b/ATS/xml/08_substitutions/0801_element_substitution/080101_head_elements_of_substitution_groups/Pos_080101_head_elements_of_substitution_groups_003/Pos_080101_head_elements_of_substitution_groups_003.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_001/Neg_A_ttcn3_module_xsd_001.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_001/Neg_A_ttcn3_module_xsd_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c296dfa6dd0eca99cca907724b7a54fd1b83f03 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_001/Neg_A_ttcn3_module_xsd_001.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type AnySimpleType allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_001 { + + import from XSD all; + + template AnySimpleType m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_001() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_002/Neg_A_ttcn3_module_xsd_002.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_002/Neg_A_ttcn3_module_xsd_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6a32832e305ff8abc74fc14a6119d355053ea867 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_002/Neg_A_ttcn3_module_xsd_002.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type AnyType allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_002 { + + import from XSD all; + + template AnyType m_msg := {{2},{1}} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_002() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_003/Neg_A_ttcn3_module_xsd_003.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_003/Neg_A_ttcn3_module_xsd_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bac6c4e75c9e55ca15568133796b74c7df2de39b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_003/Neg_A_ttcn3_module_xsd_003.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type String allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_003 { + + import from XSD all; + + template String m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_003() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_004/Neg_A_ttcn3_module_xsd_004.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_004/Neg_A_ttcn3_module_xsd_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..86a623c146fa054ea0662ab2420a390764dd60f3 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_004/Neg_A_ttcn3_module_xsd_004.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NormalizedString allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_004 { + + import from XSD all; + + template NormalizedString m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_004() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_005/Neg_A_ttcn3_module_xsd_005.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_005/Neg_A_ttcn3_module_xsd_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dc2bb180f21cf075c4caab7154843bdcdbe75ffd --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_005/Neg_A_ttcn3_module_xsd_005.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Token allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_005 { + + import from XSD all; + + template Token m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_005() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_006/Neg_A_ttcn3_module_xsd_006.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_006/Neg_A_ttcn3_module_xsd_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de1aaae0b90a5842bd8c1b6f3e9dd6ccfd17f41b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_006/Neg_A_ttcn3_module_xsd_006.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Name allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_006 { + + import from XSD all; + + template Name m_msg := "string with whitespace"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_006() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_007/Neg_A_ttcn3_module_xsd_007.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_007/Neg_A_ttcn3_module_xsd_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d250ad9322d56d044d6ea258fe1e28446c66944f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_007/Neg_A_ttcn3_module_xsd_007.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NMTOKEN allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_007 { + + import from XSD all; + + template NMTOKEN m_msg := "string with whitespace"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_007() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_008/Neg_A_ttcn3_module_xsd_008.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_008/Neg_A_ttcn3_module_xsd_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a42c30f35878bc9eaea61f7e052cc826d58e0304 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_008/Neg_A_ttcn3_module_xsd_008.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NCName allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_008 { + + import from XSD all; + + template NCName m_msg := "string with whitespace"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_008() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_008(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_009/Neg_A_ttcn3_module_xsd_009.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_009/Neg_A_ttcn3_module_xsd_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..13d796bd63b34a9cfe75654614741985501b6a4c --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_009/Neg_A_ttcn3_module_xsd_009.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type ID allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_009 { + + import from XSD all; + + template ID m_msg := "12 34"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_009() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_009(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_010/Neg_A_ttcn3_module_xsd_010.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_010/Neg_A_ttcn3_module_xsd_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..40a30ce214cf77d0fe302ab04f6b2d18a95e9660 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_010/Neg_A_ttcn3_module_xsd_010.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type IDREF allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_010 { + + import from XSD all; + + template IDREF m_msg := "ID Reference"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_010() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_010(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_011/Neg_A_ttcn3_module_xsd_011.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_011/Neg_A_ttcn3_module_xsd_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21c921130b7794f8efd9951f84b78606e14949f2 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_011/Neg_A_ttcn3_module_xsd_011.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type ENTITY allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_011 { + + import from XSD all; + + template ENTITY m_msg := "My Entity"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_011() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_011(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_012/Neg_A_ttcn3_module_xsd_012.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_012/Neg_A_ttcn3_module_xsd_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..de867333309e44592169588104ac1ffda6cb39c7 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_012/Neg_A_ttcn3_module_xsd_012.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type HexBinary allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_012 { + + import from XSD all; + + template HexBinary m_msg := 11; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_012() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_012(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_013/Neg_A_ttcn3_module_xsd_013.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_013/Neg_A_ttcn3_module_xsd_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a79577178bab440c688715a852fcdb676b9db5fc --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_013/Neg_A_ttcn3_module_xsd_013.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Base64Binary allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_013 { + + import from XSD all; + + template Base64Binary m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_013() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_013(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_014/Neg_A_ttcn3_module_xsd_014.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_014/Neg_A_ttcn3_module_xsd_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5cd48d8573bb28a2b9314ec8d83fc0a75d442662 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_014/Neg_A_ttcn3_module_xsd_014.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type AnyURI allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_014 { + + import from XSD all; + + template AnyURI m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_014() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_014(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_015/Neg_A_ttcn3_module_xsd_015.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_015/Neg_A_ttcn3_module_xsd_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e35753bda66d6a56295e62886bd41b289aed226d --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_015/Neg_A_ttcn3_module_xsd_015.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Language allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_015 { + + import from XSD all; + + template Language m_msg := "TTCN 3"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_015() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_015(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_016/Neg_A_ttcn3_module_xsd_016.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_016/Neg_A_ttcn3_module_xsd_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5e0b1dda4e66c1d9c96a066053e965d3e80f5b1b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_016/Neg_A_ttcn3_module_xsd_016.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Integer allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_016 { + + import from XSD all; + + template Integer m_msg := 1.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_016() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_016(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_017/Neg_A_ttcn3_module_xsd_017.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_017/Neg_A_ttcn3_module_xsd_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1bdf545b5d0a705b2215130e17d648cd1dae4ad2 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_017/Neg_A_ttcn3_module_xsd_017.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type PositiveInteger allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_017 { + + import from XSD all; + + template PositiveInteger m_msg := -12; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_017() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_017(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_018/Neg_A_ttcn3_module_xsd_018.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_018/Neg_A_ttcn3_module_xsd_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..309e710b42954abefb69201ba7c6c0e0cc909311 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_018/Neg_A_ttcn3_module_xsd_018.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NonPositiveInteger allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_018 { + + import from XSD all; + + template NonPositiveInteger m_msg := 3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_018() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_018(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_019/Neg_A_ttcn3_module_xsd_019.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_019/Neg_A_ttcn3_module_xsd_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f93626e5b6486d7b7a8c707b9f1cdd49858fb3b4 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_019/Neg_A_ttcn3_module_xsd_019.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NegativeInteger allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_019 { + + import from XSD all; + + template NegativeInteger m_msg := 3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_019() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_019(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_020/Neg_A_ttcn3_module_xsd_020.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_020/Neg_A_ttcn3_module_xsd_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c491dfe23e127c5df63a39cdd070c51da5655ff6 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_020/Neg_A_ttcn3_module_xsd_020.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NonNegativeInteger allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_020 { + + import from XSD all; + + template NonNegativeInteger m_msg := -1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_020() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_020(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_021/Neg_A_ttcn3_module_xsd_021.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_021/Neg_A_ttcn3_module_xsd_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..25f7e6ebda879900b60204d1e89bf7397e191346 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_021/Neg_A_ttcn3_module_xsd_021.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Long allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_021 { + + import from XSD all; + + template Long m_msg := "1"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_021() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_021(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_022/Neg_A_ttcn3_module_xsd_022.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_022/Neg_A_ttcn3_module_xsd_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..38665a536d82e5144d11a2d0785f84ae470aaa19 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_022/Neg_A_ttcn3_module_xsd_022.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type UnsignedLong allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_022 { + + import from XSD all; + + template UnsignedLong m_msg := -3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_022() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_022(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_023/Neg_A_ttcn3_module_xsd_023.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_023/Neg_A_ttcn3_module_xsd_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0fab13f410ca9119f15eb4762658f8a0f16bc9ef --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_023/Neg_A_ttcn3_module_xsd_023.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Int allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_023 { + + import from XSD all; + + template Int m_msg := 3.3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_023() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_023(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_024/Neg_A_ttcn3_module_xsd_024.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_024/Neg_A_ttcn3_module_xsd_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9ae011ccae5b1d26c6e7ad08cd24b3c5d36d990e --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_024/Neg_A_ttcn3_module_xsd_024.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type UnsignedInt allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_024 { + + import from XSD all; + + template UnsignedInt m_msg := -3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_024() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_024(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_025/Neg_A_ttcn3_module_xsd_025.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_025/Neg_A_ttcn3_module_xsd_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2dea143bec5ef1aab709f6916b7ae122b0478739 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_025/Neg_A_ttcn3_module_xsd_025.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Short allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_025 { + + import from XSD all; + + template Short m_msg := 32770; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_025() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_025(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_026/Neg_A_ttcn3_module_xsd_026.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_026/Neg_A_ttcn3_module_xsd_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..53da4c90b2dd3ebecfda40aec53d11c0208794be --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_026/Neg_A_ttcn3_module_xsd_026.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type UnsignedShort allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_026 { + + import from XSD all; + + template UnsignedShort m_msg := -2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_026() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_026(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_027/Neg_A_ttcn3_module_xsd_027.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_027/Neg_A_ttcn3_module_xsd_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d332bf83718710ed0acaf8fff40299f2e8c29dba --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_027/Neg_A_ttcn3_module_xsd_027.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Byte allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_027 { + + import from XSD all; + + template Byte m_msg := 130; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_027() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_027(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_028/Neg_A_ttcn3_module_xsd_028.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_028/Neg_A_ttcn3_module_xsd_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7972df9d035ffc47ea389d1bdd22210fc699a596 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_028/Neg_A_ttcn3_module_xsd_028.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type UnsignedByte allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_028 { + + import from XSD all; + + template UnsignedByte m_msg := -1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_028() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_028(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_029/Neg_A_ttcn3_module_xsd_029.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_029/Neg_A_ttcn3_module_xsd_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..bef9680b82399695ec6c33978a363f95a82e28ec --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_029/Neg_A_ttcn3_module_xsd_029.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Decimal allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_029 { + + import from XSD all; + + template Decimal m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_029() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_029(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_030/Neg_A_ttcn3_module_xsd_030.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_030/Neg_A_ttcn3_module_xsd_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d5e370ae1f7c8937c4ddf3816ea76f9b142a249 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_030/Neg_A_ttcn3_module_xsd_030.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Float allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_030 { + + import from XSD all; + + template Float m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_030() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_030(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_031/Neg_A_ttcn3_module_xsd_031.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_031/Neg_A_ttcn3_module_xsd_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7550a75f16947fcec6be6062e53ee72b1cf5128a --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_031/Neg_A_ttcn3_module_xsd_031.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Double allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_031 { + + import from XSD all; + + template Double m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_031() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_031(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_032/Neg_A_ttcn3_module_xsd_032.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_032/Neg_A_ttcn3_module_xsd_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..876406b85ed9254a693e98daf55b0641111215ec --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_032/Neg_A_ttcn3_module_xsd_032.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Duration allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_032 { + + import from XSD all; + + template Duration m_msg := "30 min"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_032() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_032(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_033/Neg_A_ttcn3_module_xsd_033.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_033/Neg_A_ttcn3_module_xsd_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1dc25a535a06c4d3218f1f913cda7a20ea2f84b5 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_033/Neg_A_ttcn3_module_xsd_033.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type DateTime allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_033 { + + import from XSD all; + + template DateTime m_msg := "14-12-12-12:00:00"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_033() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_033(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_034/Neg_A_ttcn3_module_xsd_034.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_034/Neg_A_ttcn3_module_xsd_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c58c6d3cb6a2163c57c6359a6d64a024fbd4e2f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_034/Neg_A_ttcn3_module_xsd_034.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Time allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_034 { + + import from XSD all; + + template Time m_msg := "66:66"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_034() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_034(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_035/Neg_A_ttcn3_module_xsd_035.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_035/Neg_A_ttcn3_module_xsd_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e6c0c7108dd1d5c65176773273fa7ca86aeb453d --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_035/Neg_A_ttcn3_module_xsd_035.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Date allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_035 { + + import from XSD all; + + template Date m_msg := "14.13.13"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_035() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_035(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_036/Neg_A_ttcn3_module_xsd_036.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_036/Neg_A_ttcn3_module_xsd_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..608ea77d97dd10c7cb23dadaddb4d4c84d581734 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_036/Neg_A_ttcn3_module_xsd_036.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type GYearMonth allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_036 { + + import from XSD all; + + template GYearMonth m_msg := "14-13"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_036() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_036(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_037/Neg_A_ttcn3_module_xsd_037.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_037/Neg_A_ttcn3_module_xsd_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b73e3dc084c7972682a3bcacba01b93dbff44626 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_037/Neg_A_ttcn3_module_xsd_037.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type GYear allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_037 { + + import from XSD all; + + template GYear m_msg := "14"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_037() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_037(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_038/Neg_A_ttcn3_module_xsd_038.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_038/Neg_A_ttcn3_module_xsd_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8de5dce2049ec256d5c23ca3334dc8c6c24d9abd --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_038/Neg_A_ttcn3_module_xsd_038.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type GMonthDay allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_038 { + + import from XSD all; + + template GMonthDay m_msg := "12-18"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_038() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_038(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_039/Neg_A_ttcn3_module_xsd_039.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_039/Neg_A_ttcn3_module_xsd_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b99942e7bb297bccdcb4981238ac02168e38a88 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_039/Neg_A_ttcn3_module_xsd_039.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type GDay allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_039 { + + import from XSD all; + + template GDay m_msg := "18"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_039() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_039(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_040/Neg_A_ttcn3_module_xsd_040.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_040/Neg_A_ttcn3_module_xsd_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d9f052fe0cbf2e1e4718c72283c391367e893a33 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_040/Neg_A_ttcn3_module_xsd_040.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type GMonth allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_040 { + + import from XSD all; + + template GMonth m_msg := "12"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_040() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_040(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_041/Neg_A_ttcn3_module_xsd_041.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_041/Neg_A_ttcn3_module_xsd_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..826e91e7b65d8cba80807df40082f99e105ddd93 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_041/Neg_A_ttcn3_module_xsd_041.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type NMTOKENS allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_041 { + + import from XSD all; + + template NMTOKENS m_msg := {1, 2} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_041() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_041(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_042/Neg_A_ttcn3_module_xsd_042.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_042/Neg_A_ttcn3_module_xsd_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..139280b108906c6da44b5314a62e73c91c2fd2b9 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_042/Neg_A_ttcn3_module_xsd_042.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type IDREFS allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_042 { + + import from XSD all; + + template IDREFS m_msg := {"1 2 3"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_042() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_042(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_043/Neg_A_ttcn3_module_xsd_043.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_043/Neg_A_ttcn3_module_xsd_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3fad1d12ac2c0cf7376b7350e89be3dd3307d411 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_043/Neg_A_ttcn3_module_xsd_043.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type ENTITIES allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_043 { + + import from XSD all; + + template ENTITIES m_msg := {"entity_1 , entity_2"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_043() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_043(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_044/Neg_A_ttcn3_module_xsd_044.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_044/Neg_A_ttcn3_module_xsd_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..56fee9f22bccca182775883ab1c41bf6e4b9d387 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_044/Neg_A_ttcn3_module_xsd_044.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type QName allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_044 { + + import from XSD all; + + template QName m_msg := {"", "name with whitespace"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_044() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_044(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_045/Neg_A_ttcn3_module_xsd_045.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_045/Neg_A_ttcn3_module_xsd_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8eae44e07f3763cf0d00b8e6706a934af10e9746 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_045/Neg_A_ttcn3_module_xsd_045.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type Boolean allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_045 { + + import from XSD all; + + template Boolean m_msg := fail; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_045() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_045(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_046/Neg_A_ttcn3_module_xsd_046.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_046/Neg_A_ttcn3_module_xsd_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..58313057b3598a1d0edc7ab3df15feb328412e9b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_046/Neg_A_ttcn3_module_xsd_046.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type XMLCompatibleString allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_046 { + + import from XSD all; + + template XMLCompatibleString m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_046() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_046(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_047/Neg_A_ttcn3_module_xsd_047.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_047/Neg_A_ttcn3_module_xsd_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ffd5c862bb746b9b0b95b02c635255da01ecca8a --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_047/Neg_A_ttcn3_module_xsd_047.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type XMLStringWithNoWhitespace allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_047 { + + import from XSD all; + + template XMLStringWithNoWhitespace m_msg := "a b c"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_047() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_047(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_048/Neg_A_ttcn3_module_xsd_048.ttcn b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_048/Neg_A_ttcn3_module_xsd_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..20436eb08680bfec40990ca188c7ce5072116b53 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Neg_A_ttcn3_module_xsd_048/Neg_A_ttcn3_module_xsd_048.ttcn @@ -0,0 +1,33 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the builtin XSD type XMLStringWithNoCRLFHT allows only valid values + ** @verdict pass reject + ***************************************************/ +module Neg_A_ttcn3_module_xsd_048 { + + import from XSD all; + + template XMLStringWithNoCRLFHT m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Neg_A_ttcn3_module_xsd_048() runs on C system C { + // set a verdict before since valueof should throw error + setverdict(fail, "Should not be able to create an invalid value of the given built-in XSD type", m_msg); + log(valueof(m_msg)); // if testcase is compiling, valueof is expected to throw an testcase error since the value is invalid + } + + control { + execute(TC_Neg_A_ttcn3_module_xsd_048(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_001/Pos_A_ttcn3_module_xsd_001.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_001/Pos_A_ttcn3_module_xsd_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3e560d3a5f7ad130f359bbd8f7f609be398aaa36 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_001/Pos_A_ttcn3_module_xsd_001.ttcn @@ -0,0 +1,38 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type AnySimpleType + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_001 { + + import from XSD all; + + template AnySimpleType m_msg :="abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_001() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_001(), PX_TC_EXECUTION_TIMEOUT); + } + +} + diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_002/Pos_A_ttcn3_module_xsd_002.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_002/Pos_A_ttcn3_module_xsd_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6babfd8d263c0048a9b3c8e0a914d2376228ab5f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_002/Pos_A_ttcn3_module_xsd_002.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475, updated by STF 521 + ** @version 0.0.2 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type AnyType + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_002 { + + import from XSD all; + + template AnyType m_msg := {embed_values := omit, attr := omit, elem_list := {"a"}} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_002() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_002(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_003/Pos_A_ttcn3_module_xsd_003.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_003/Pos_A_ttcn3_module_xsd_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..99e6598de008441ceb45d8890bf8878f43820968 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_003/Pos_A_ttcn3_module_xsd_003.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type String + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_003 { + + import from XSD all; + + template String m_msg :="abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_003() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_003(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_004/Pos_A_ttcn3_module_xsd_004.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_004/Pos_A_ttcn3_module_xsd_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a571951919c4cd452df0a0b3f37aa222d74428c6 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_004/Pos_A_ttcn3_module_xsd_004.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NormalizedString + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_004 { + + import from XSD all; + + template NormalizedString m_msg :="abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_004() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_004(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_005/Pos_A_ttcn3_module_xsd_005.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_005/Pos_A_ttcn3_module_xsd_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e39421f95a8e660044308a16b25f6d5e580ce405 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_005/Pos_A_ttcn3_module_xsd_005.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Token + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_005 { + + import from XSD all; + + template Token m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_005() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_005(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_006/Pos_A_ttcn3_module_xsd_006.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_006/Pos_A_ttcn3_module_xsd_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..809796400b903ab2b7720305ef0b3b953830b18a --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_006/Pos_A_ttcn3_module_xsd_006.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Name + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_006 { + + import from XSD all; + + template Name m_msg := "name"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_006() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_006(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_007/Pos_A_ttcn3_module_xsd_007.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_007/Pos_A_ttcn3_module_xsd_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..507ba82d44b24604bc8270c401be5e78601025bd --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_007/Pos_A_ttcn3_module_xsd_007.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NMTOKEN + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_007 { + + import from XSD all; + + template NMTOKEN m_msg := "NMToken"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_007() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_007(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_008/Pos_A_ttcn3_module_xsd_008.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_008/Pos_A_ttcn3_module_xsd_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2d054ae4bb21918b974c41467e86fc9fb918215e --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_008/Pos_A_ttcn3_module_xsd_008.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NCName + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_008 { + + import from XSD all; + + template NCName m_msg := "SomeName-WithoutSpace"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_008() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_008(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_009/Pos_A_ttcn3_module_xsd_009.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_009/Pos_A_ttcn3_module_xsd_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa4acaba72798c10b0383d78d7883ee8d6a3dda6 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_009/Pos_A_ttcn3_module_xsd_009.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type ID + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_009 { + + import from XSD all; + + template ID m_msg := "1234"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_009() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_009(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_010/Pos_A_ttcn3_module_xsd_010.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_010/Pos_A_ttcn3_module_xsd_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..18e9bbe8851e35ae70d136956c3bc04982b8c012 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_010/Pos_A_ttcn3_module_xsd_010.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type IDREF + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_010 { + + import from XSD all; + + template IDREF m_msg := "ID-Reference"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_010() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_010(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_011/Pos_A_ttcn3_module_xsd_011.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_011/Pos_A_ttcn3_module_xsd_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..19cbdc264f8637e4aad62629aa4f8b6e722f3958 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_011/Pos_A_ttcn3_module_xsd_011.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type ENTITY + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_011 { + + import from XSD all; + + template ENTITY m_msg := "MyEntity"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_011() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_011(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_012/Pos_A_ttcn3_module_xsd_012.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_012/Pos_A_ttcn3_module_xsd_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..95cd9047bd6ca96d62bd97d6113d82caca94d999 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_012/Pos_A_ttcn3_module_xsd_012.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type HexBinary + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_012 { + + import from XSD all; + + template HexBinary m_msg := '11001100'O; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_012() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_012(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_013/Pos_A_ttcn3_module_xsd_013.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_013/Pos_A_ttcn3_module_xsd_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4ff950df6100e48b02911a279094d5df1893e8bb --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_013/Pos_A_ttcn3_module_xsd_013.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Base64Binary + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_013 { + + import from XSD all; + + template Base64Binary m_msg := 'A12654778899'O; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_013() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_013(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_014/Pos_A_ttcn3_module_xsd_014.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_014/Pos_A_ttcn3_module_xsd_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1412e4cf563146cc3dabc4c116029b5ea0864b2f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_014/Pos_A_ttcn3_module_xsd_014.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type AnyURI + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_014 { + + import from XSD all; + + template AnyURI m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_014() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_014(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_015/Pos_A_ttcn3_module_xsd_015.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_015/Pos_A_ttcn3_module_xsd_015.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab9879f983467dad3453d5c20fe3844be5b3ddbb --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_015/Pos_A_ttcn3_module_xsd_015.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Language + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_015 { + + import from XSD all; + + template Language m_msg := "De-AT"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_015() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_015(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_016/Pos_A_ttcn3_module_xsd_016.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_016/Pos_A_ttcn3_module_xsd_016.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7fbdbbf33e98b3ee20be3380487cf2a56114a91e --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_016/Pos_A_ttcn3_module_xsd_016.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Integer + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_016 { + + import from XSD all; + + template Integer m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_016() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_016(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_017/Pos_A_ttcn3_module_xsd_017.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_017/Pos_A_ttcn3_module_xsd_017.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..62ed0f1ad57191b78514c9a3c1197a692e0236d3 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_017/Pos_A_ttcn3_module_xsd_017.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type PositiveInteger + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_017 { + + import from XSD all; + + template PositiveInteger m_msg := 12; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_017() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_017(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_018/Pos_A_ttcn3_module_xsd_018.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_018/Pos_A_ttcn3_module_xsd_018.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ef8928dec81652e47cc0243b01bd659b8748febc --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_018/Pos_A_ttcn3_module_xsd_018.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NonPositiveInteger + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_018 { + + import from XSD all; + + template NonPositiveInteger m_msg := -3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_018() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_018(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_019/Pos_A_ttcn3_module_xsd_019.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_019/Pos_A_ttcn3_module_xsd_019.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..65e21a9f43859e6cebf2fc8f81f38618b5293d4a --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_019/Pos_A_ttcn3_module_xsd_019.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NegativeInteger + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_019 { + + import from XSD all; + + template NegativeInteger m_msg := -10; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_019() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_019(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_020/Pos_A_ttcn3_module_xsd_020.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_020/Pos_A_ttcn3_module_xsd_020.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..419d70c029151f757692b2364bb5f169b87f5c79 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_020/Pos_A_ttcn3_module_xsd_020.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NonNegativeInteger + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_020 { + + import from XSD all; + + template NonNegativeInteger m_msg := 2; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_020() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_020(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_021/Pos_A_ttcn3_module_xsd_021.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_021/Pos_A_ttcn3_module_xsd_021.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..500ced4f635f594b72c537a7854a5ad0592e2800 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_021/Pos_A_ttcn3_module_xsd_021.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Long + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_021 { + + import from XSD all; + + template Long m_msg := 123; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_021() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_021(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_022/Pos_A_ttcn3_module_xsd_022.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_022/Pos_A_ttcn3_module_xsd_022.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59d768c02949c02874fa894def146b59873a84aa --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_022/Pos_A_ttcn3_module_xsd_022.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type UnsignedLong + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_022 { + + import from XSD all; + + template UnsignedLong m_msg := 10; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_022() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_022(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_023/Pos_A_ttcn3_module_xsd_023.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_023/Pos_A_ttcn3_module_xsd_023.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fe1edc392a0e7dfe67af9a0658f74b7698b01f1b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_023/Pos_A_ttcn3_module_xsd_023.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Int + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_023 { + + import from XSD all; + + template Int m_msg := 23; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_023() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_023(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_024/Pos_A_ttcn3_module_xsd_024.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_024/Pos_A_ttcn3_module_xsd_024.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f82646868d18cb4f63058c29766e56890298e235 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_024/Pos_A_ttcn3_module_xsd_024.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type UnsignedInt + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_024 { + + import from XSD all; + + template UnsignedInt m_msg := 3; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_024() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_024(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_025/Pos_A_ttcn3_module_xsd_025.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_025/Pos_A_ttcn3_module_xsd_025.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b7a590ba2c9689ee78fd69581e59829f0c33814a --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_025/Pos_A_ttcn3_module_xsd_025.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Short + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_025 { + + import from XSD all; + + template Short m_msg := 32767; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_025() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_025(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_026/Pos_A_ttcn3_module_xsd_026.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_026/Pos_A_ttcn3_module_xsd_026.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..accf05722257634206884645dad5c7930107bb62 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_026/Pos_A_ttcn3_module_xsd_026.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type UnsignedShort + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_026 { + + import from XSD all; + + template UnsignedShort m_msg := 65535; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_026() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_026(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_027/Pos_A_ttcn3_module_xsd_027.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_027/Pos_A_ttcn3_module_xsd_027.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1ed145abba84473e9172ba87c858e42fc88e7bb8 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_027/Pos_A_ttcn3_module_xsd_027.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Byte + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_027 { + + import from XSD all; + + template Byte m_msg := 127; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_027() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_027(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_028/Pos_A_ttcn3_module_xsd_028.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_028/Pos_A_ttcn3_module_xsd_028.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ecb8d3942afe4eb48ce92519f32957dc00691f25 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_028/Pos_A_ttcn3_module_xsd_028.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type UnsignedByte + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_028 { + + import from XSD all; + + template UnsignedByte m_msg := 255; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_028() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_028(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_029/Pos_A_ttcn3_module_xsd_029.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_029/Pos_A_ttcn3_module_xsd_029.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9fd59a47bec655b96dcceb74b3db245ae213d0a5 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_029/Pos_A_ttcn3_module_xsd_029.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Decimal + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_029 { + + import from XSD all; + + template Decimal m_msg := 1.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_029() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_029(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_030/Pos_A_ttcn3_module_xsd_030.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_030/Pos_A_ttcn3_module_xsd_030.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b01e061e143c856ef514bb1954a2784e6e2c827f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_030/Pos_A_ttcn3_module_xsd_030.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Float + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_030 { + + import from XSD all; + + template Float m_msg := 1.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_030() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_030(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_031/Pos_A_ttcn3_module_xsd_031.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_031/Pos_A_ttcn3_module_xsd_031.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..930dd107e30b6069b9eab2cb3475917957ea6c4e --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_031/Pos_A_ttcn3_module_xsd_031.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Double + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_031 { + + import from XSD all; + + template Double m_msg := 1.0; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_031() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_031(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_032/Pos_A_ttcn3_module_xsd_032.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_032/Pos_A_ttcn3_module_xsd_032.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..017a96b38d348d39e562d18a9b264bb8a98ec677 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_032/Pos_A_ttcn3_module_xsd_032.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Duration + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_032 { + + import from XSD all; + + template Duration m_msg := "P1Y2M2DT2H22M"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_032() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_032(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_033/Pos_A_ttcn3_module_xsd_033.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_033/Pos_A_ttcn3_module_xsd_033.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..751c9ba083298407bddd95be392350851441252b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_033/Pos_A_ttcn3_module_xsd_033.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type DateTime + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_033 { + + import from XSD all; + + template DateTime m_msg := "2014-12-12T12:00:00"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_033() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_033(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_034/Pos_A_ttcn3_module_xsd_034.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_034/Pos_A_ttcn3_module_xsd_034.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0acb7dc5fb760079496e6d56a85abbc9a77799bf --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_034/Pos_A_ttcn3_module_xsd_034.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Time + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_034 { + + import from XSD all; + + template Time m_msg := "12:12:00-05:00"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_034() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_034(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_035/Pos_A_ttcn3_module_xsd_035.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_035/Pos_A_ttcn3_module_xsd_035.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e16d5d1b8398e3fc88fceb21e4a21928cc1ef33f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_035/Pos_A_ttcn3_module_xsd_035.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Date + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_035 { + + import from XSD all; + + template Date m_msg := "2014-12-18"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_035() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_035(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_036/Pos_A_ttcn3_module_xsd_036.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_036/Pos_A_ttcn3_module_xsd_036.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..082e18072018d7de7286186ab6366fb94e6743c6 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_036/Pos_A_ttcn3_module_xsd_036.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type GYearMonth + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_036 { + + import from XSD all; + + template GYearMonth m_msg := "2014-12"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_036() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_036(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_037/Pos_A_ttcn3_module_xsd_037.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_037/Pos_A_ttcn3_module_xsd_037.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aae7e6802f0e9fbefaf53bf936d4d113167d54ce --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_037/Pos_A_ttcn3_module_xsd_037.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type GYear + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_037 { + + import from XSD all; + + template GYear m_msg := "2014"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_037() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_037(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_038/Pos_A_ttcn3_module_xsd_038.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_038/Pos_A_ttcn3_module_xsd_038.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..863677cfc0edcc89210527d91e946f02911643a0 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_038/Pos_A_ttcn3_module_xsd_038.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type GMonthDay + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_038 { + + import from XSD all; + + template GMonthDay m_msg := "--12-18"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_038() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_038(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_039/Pos_A_ttcn3_module_xsd_039.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_039/Pos_A_ttcn3_module_xsd_039.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..00a90f96d9359c472d347db098171b346d5a9993 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_039/Pos_A_ttcn3_module_xsd_039.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type GDay + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_039 { + + import from XSD all; + + template GDay m_msg := "---18"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_039() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_039(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_040/Pos_A_ttcn3_module_xsd_040.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_040/Pos_A_ttcn3_module_xsd_040.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9894f46372400a5c9ba652c61effcd09424630e1 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_040/Pos_A_ttcn3_module_xsd_040.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type GMonth + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_040 { + + import from XSD all; + + template GMonth m_msg := "--12"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_040() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_040(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_041/Pos_A_ttcn3_module_xsd_041.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_041/Pos_A_ttcn3_module_xsd_041.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3f682b92015f9973730d6f918252ef2956ba1bfa --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_041/Pos_A_ttcn3_module_xsd_041.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type NMTOKENS + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_041 { + + import from XSD all; + + template NMTOKENS m_msg := {"a", "b"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_041() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_041(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_042/Pos_A_ttcn3_module_xsd_042.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_042/Pos_A_ttcn3_module_xsd_042.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b1c392b03c9663933ce62a772cfd22ff8deded66 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_042/Pos_A_ttcn3_module_xsd_042.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type IDREFS + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_042 { + + import from XSD all; + + template IDREFS m_msg := {"123"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_042() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_042(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_043/Pos_A_ttcn3_module_xsd_043.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_043/Pos_A_ttcn3_module_xsd_043.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4eea69dd130bf78482536bccb21fb8b7b2389ab8 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_043/Pos_A_ttcn3_module_xsd_043.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type ENTITIES + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_043 { + + import from XSD all; + + template ENTITIES m_msg := {"entity_1", "entity_2"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_043() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_043(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_044/Pos_A_ttcn3_module_xsd_044.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_044/Pos_A_ttcn3_module_xsd_044.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..41611a11493420d73250eab76cb8c6508bc59118 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_044/Pos_A_ttcn3_module_xsd_044.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type QName + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_044 { + + import from XSD all; + + template QName m_msg := {"http://example.com", "name"} + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_044() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_044(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_045/Pos_A_ttcn3_module_xsd_045.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_045/Pos_A_ttcn3_module_xsd_045.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..955007e215ffc95e15320899291b4ee5a3574039 --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_045/Pos_A_ttcn3_module_xsd_045.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type Boolean + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_045 { + + import from XSD all; + + template Boolean m_msg := true; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_045() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_045(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_046/Pos_A_ttcn3_module_xsd_046.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_046/Pos_A_ttcn3_module_xsd_046.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..59911d0ea7a3b982dee697862b75430e7631247d --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_046/Pos_A_ttcn3_module_xsd_046.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type XMLCompatibleString + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_046 { + + import from XSD all; + + template XMLCompatibleString m_msg := "x"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_046() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_046(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_047/Pos_A_ttcn3_module_xsd_047.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_047/Pos_A_ttcn3_module_xsd_047.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..570143ecba75f3142b716c2d199dd6ef060eb85b --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_047/Pos_A_ttcn3_module_xsd_047.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type XMLStringWithNoWhitespace + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_047 { + + import from XSD all; + + template XMLStringWithNoWhitespace m_msg := "StringWithNoWhitespace"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_047() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_047(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_048/Pos_A_ttcn3_module_xsd_048.ttcn b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_048/Pos_A_ttcn3_module_xsd_048.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ce9dffb71ebea343ff303f8d784bd9a0a161ab8f --- /dev/null +++ b/ATS/xml/A_ttcn3_module_xsd/Pos_A_ttcn3_module_xsd_048/Pos_A_ttcn3_module_xsd_048.ttcn @@ -0,0 +1,37 @@ +/*************************************************** + ** @author STF 475 + ** @version 0.0.1 + ** @purpose 9:A, Ensure the module XSD is available and contains the builtin XSD type XMLStringWithNoCRLFHT + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_A_ttcn3_module_xsd_048 { + + import from XSD all; + + template XMLStringWithNoCRLFHT m_msg := "abc"; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type component C { + } + + testcase TC_Pos_A_ttcn3_module_xsd_048() runs on C system C { + + // encode the message + if (isvalue(m_msg)) { + setverdict(pass, "Built-in XSD type was found and TCI value was created"); + } else { + setverdict(fail, "Failure to create a value of the given built-in XSD type"); + } + } + + control { + execute(TC_Pos_A_ttcn3_module_xsd_048(), PX_TC_EXECUTION_TIMEOUT); + } + +} diff --git a/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.ttcn b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7d405f57d5abf925fec06699ba2ddfb39fea4e3c --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.ttcn @@ -0,0 +1,90 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:B.3.27, The noType insturction overriding "useUnion" + ** @verdict pass accept, ttcn3verdict:pass +***************************************************/ +// The following requirements are tested: +// The "noType" encoding variant can be applied to any TTCN-3 value or template, +// where normally an xsi:type attribute would be generated when encoding this element +// (see clause 5.1.5). This is normally the result of the "useType" or "useUnion" +// encoding instructions appended to the type of the value or template. This is +// especially useful for suppressing the type identification attribute for elements +// derived from simpleType via union. The "noType" encoding instruction takes +// precedence over the "useType" and "useUnion" encoding instructions. + +module Pos_B0327_no_type_001 { + + import from schema_Pos_B0327_no_type_001 language "XSD" all; + + template MyType m_msg := { integer_ := 5 } with { variant "noType" }; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type universal charstring File; + type record of File FileList; + + type port P message { + inout all; + } + type component C { + port P p; + } + + /** + * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure + * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file + * @param p_referenceXmlFile the XML file + * @param p_xsdFileList the list of XSD files + * @param p_matchError the error result in case it did not match + * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent. + * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure + */ + external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean; + + testcase TC_Pos_B0327_no_type_001() runs on C system C { + var Raw v_rcv; + var universal charstring v_matchError; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + // compare the encoded message with the reference XML file + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + if (matchFile(v_rcv, "Pos_B0327_no_type_001.xml", { "Pos_B0327_no_type_001.xsd" }, v_matchError)) { + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template and reference XML"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } else { + setverdict(fail, v_matchError); + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Pos_B0327_no_type_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xml b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xml new file mode 100644 index 0000000000000000000000000000000000000000..a22095dc61e1c980f75e1a450bc36e9e100637ad --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xml @@ -0,0 +1,2 @@ + +5 \ No newline at end of file diff --git a/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xsd b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..4ee22e343baff4f7aaa45c3a5e33a4349c4bfdf9 --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0327_no_type/Pos_B0327_no_type_001/Pos_B0327_no_type_001.xsd @@ -0,0 +1,9 @@ + + + + + + + diff --git a/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_001/B0329_xml_header_control_001.ttcn b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_001/B0329_xml_header_control_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..882bb9993a5960900f29d71b7fea7cf0d78957f2 --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_001/B0329_xml_header_control_001.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.1, Use of the xmlHeader parameter in the enc_value function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_B0329_xml_header_control_001 { + + import from schema_Pos_B0329_xml_header_control_001 language "XSD" all; + + template Test m_msg := "abc"; + + type component C { + } + + testcase TC_Pos_B0329_xml_header_control_001() runs on C { + var universal charstring v_encoded := encvalue_unichar(m_msg, -, "xmlHeader"); + // Naive test for XML header presence. If needed, more complicated one should be implemented + if (lengthof(v_encoded) >= 5 and substr(v_encoded, 0, 5) == " + + + diff --git a/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_002/B0329_xml_header_control_002.ttcn b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_002/B0329_xml_header_control_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9b25f29f6464f4f82872eef5eb022f156b4e7a98 --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B03_encoding_instructions/B0329_xml_header_control/B0329_xml_header_control_002/B0329_xml_header_control_002.ttcn @@ -0,0 +1,26 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:6.2.1, Use of the noXmlHeader parameter in the enc_value function + ** @verdict pass accept, ttcn3verdict:pass + ***************************************************/ +module Pos_B0329_xml_header_control_002 { + + import from schema_Pos_B0329_xml_header_control_002 language "XSD" all; + + template Test m_msg := "abc"; + + type component C { + } + + testcase TC_Pos_B0329_xml_header_control_002() runs on C { + var universal charstring v_encoded := encvalue_unichar(m_msg, -, "noXmlHeader"); + // Naive test for XML header presence. If needed, more complicated one should be implemented + if (lengthof(v_encoded) >= 5 and substr(v_encoded, 0, 5) == " + + + diff --git a/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.ttcn b/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5abfa7de71536c0f5681d3b01dd33ec886e2b2c --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.ttcn @@ -0,0 +1,68 @@ +/*************************************************** + ** @author STF 521 + ** @version 0.0.1 + ** @purpose 9:7.5.1, Verify that XSD types cannot be encoded + ** @verdict pass reject +***************************************************/ +// The following requirements are tested: +// If templates or values of types with the "XML" encode attribute (or any of its synonyms +// – i.e. TTCN-3 types that are a result of conversion from XSD) are used as an argument of +// a communication operation, a variant attribute containing the "element" encoding instruction +// shall be assigned to it. Using a value or template of a type that doesn’t contain this +// encoding instruction shall cause an error. + +module Neg_B_top_level_001 { + + import from schema_Neg_B_top_level_001 "XSD" all; + + template Elem_simple_restr m_msg := 1; + + + + /** + * @desc The timeout given in seconds after which the test case will be stopped. + */ + modulepar float PX_TC_EXECUTION_TIMEOUT := 5.0; + + type universal charstring Raw; + + type port P message { + inout all; + } + type component C { + port P p; + } + + testcase TC_Neg_B_top_level_001() runs on C system C { + var Raw v_rcv; + + map(self:p, system:p); + + // encode the message + p.send(m_msg); + + alt { + [] p.check(receive(Raw:?) -> value v_rcv) { + log("XML message ", v_rcv); + alt { + // match decoded value to pass test + [] p.receive(m_msg) { + setverdict(pass, "Decoded value matches encoded template"); + } + [] p.receive { + setverdict(fail, "XML decoding failure"); + } + } + } + [] p.receive { + setverdict(fail, "Raw decoding failure"); + } + } + } + + control { + execute(TC_Neg_B_top_level_001(), PX_TC_EXECUTION_TIMEOUT); + } + + +} diff --git a/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.xsd b/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.xsd new file mode 100644 index 0000000000000000000000000000000000000000..03ea0acf9b61a543cbd0078a36d94709231bd186 --- /dev/null +++ b/ATS/xml/B_encoding_instructions/B_top_level/Neg_B_top_level_001/Neg_B_top_level_001.xsd @@ -0,0 +1,8 @@ + + + + + + diff --git a/ATS/xml/README.txt b/ATS/xml/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..f5de2fec99c6f70335b4ce556865078fe37aa427 --- /dev/null +++ b/ATS/xml/README.txt @@ -0,0 +1,92 @@ +TTCN-3 Part 9 (XML) conformance test suite preliminary (unofficial) instructions +======================================================= + +These are preliminary instructions on how to use the TTCN-3 conformance test suite. +Unlike ATSs in the usual context, this ATS does _not_ provide any means for test +automation, but the TTCN-3 files provide the test inputs for the TTCN-3 tool - in this case +the TTCN-3 tool is the IUT. This means that test automation has to be somehow scripted, however, +from the provided ATS it should be clear how the output should be interpreted. + +1) ATS organization + + The ATS is organized according to the clauses of the TTCN-3 standard part 1. There are + either positive syntactic tests, negative syntactic tests, positive semantic tests, or + negative semantic tests. + + Except for the negative syntactic tests, all TTCN-3 files from the other three categories + are always syntactically correct. In addition, the positive syntactic tests are designed + to be semantically correct as well. The negative semantic tests are designed to violate the + semantics only in the one property that is subject of the test - at least to the degree that + it is possible. Because all test cases are syntactically correct (except for the negative + syntactic tests), the semantic and negative semantic tests are syntactically correct as well. + + Every TTCN-3 module corresponds to one TTCN-3 conformance test. Where more than one module is + needed, the TTCN-3 file contains multiple modules. + +2) Document tags + + Every module is annotated with document tags. Of relevance for the test automation tooling + is the @verdict tag on top of each module (tag usage adaption in the TTCN-3 maintenance STF + is pending). It is composed of three parts: the tag, the conformance verdict, and keywords + regarding the expected output. + + @verdict pass accept, ttcn3verdict:pass + + Hence the format of this tag is a three column entry with "@verdict", "pass", and + "accept, ttcn3verdict:pass, manual:'Freetext validation'". + In order to reach the "pass" verdict, the TTCN-3 tool under test, the IUT, must accept the + TTCN-3 module as test input. The result of its execution must be the TTCN-3 verdict pass. + When needed, a manual inspection of the execution results is required. + Therefore, if the TTCN-3 verdict is pass after the execution of the module, the IUT passes + the conformance test. If the tool output is anything else, or it does not comply + with the manual inspection, it fails the conformance test. + + The keywords in use to describe the third column, i.e. the expected output by the IUT, are (currently) as + follows: + + reject + accept, noexecution + accept, ttcn3verdict:none + accept, ttcn3verdict:pass + accept, ttcn3verdict:inconc + accept, ttcn3verdict:fail + accept, ttcn3verdict:error + accept, ttcn3verdict:xxx, manual:"Validation inspection, free text" (see Note) + + Note: 'xxx' for ttcn3verdict is a placeholder for verdict value. The actual test cases must + have one of the allowed values 'none', 'pass', 'inconc', 'fail', or 'error' in place of 'xxx'. + + "reject" implies that the TTCN-3 module is either rejected at compile-time or at execution time. + In the conformance test, we do not differentiate between these two cases as the standard does not + make any statement where semantic checks have to be performed. + + "accept, noexecution" implies that the TTCN-3 module should be accepted by the TTCN-3 tool after + the syntactic check. For passing the conformance test, the module simply has to be accepted and + an execution is not necessary. + + "accept, ttcn3vercit:xxx" implies that the TTCN-3 module should be accepted by the TTCN-3 tool + after the syntactic check and that an execution should take place. The result of the execution + should be a TTCN-3 verdict and the "xxx" denotes what verdict is the exepcted verdict. If the + verdict differs from the specified "xxx", the conformance test fails. Otherwise, it passes. + + In the usual case, each TTCN-3 file contains only one test case. In these cases the verdict + determination is clear. In a few cases, the TTCN-3 file contains more than one test case. + In that case, the overall conformance verdict is determined according to the TTCN-3 verdict + overwrite rules applied to the results of each test case. Let's say we have two test cases. + The first test case ends with the verdict "fail" and the second one ends with the verdict "pass". + Then the overall verdict is "fail". + + The manual results inspection is a free text describing how a valid out should look like. The text + is informal since different tools have different logging formats and facilities. The instruction + is surrounded by single or double quotas on a single line: + + @verdict pass, testverdict:pass, manual:'The following elements are logged: charstring "Extra", record { 1, "HELLO"}, integer template "?". Make sure the elements are logged at setverdict, at MTC end, and at test case end.' + + All notations are designed to be easily machine readable. Therefore, the test automation using + some sort of scripting will only take a small amount of time. + +3) Other prerequisites + + In order to test communication and matching behavior, we expect that the test cases are executed + using a loopback adapter. +