diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20b8e2f93d3705e0491191a4d5a9b41060fef204..dda1b8e57b3fcdc3b989d5919b5f8d74b9a4ace7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,10 @@ stages: - package - deploy -before_script: - - apk add bash git +default: + image: alpine + before_script: + - apk add bash git # format-check verifies that our tests follow guide lines, are well named and # formatted. diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_nested_types_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6d722b1b9ee5f2c3c4fe52047508f70b866f88ff --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/Sem_05040101_nested_types_001.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:5.4.1.1, Ensure formal parameters accept nested types. +// @verdict pass accept +module Sem_05040101_nested_types_001 { + +type component GeneralComp {} + +function f(in record of integer n) { + setverdict(pass); +} + +testcase TC_Sem_05040101_nested_types_001() runs on GeneralComp { + f({1, 2, 3, 4}); +} + +control { + execute(TC_Sem_05040101_nested_types_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_nested_types_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..1fa8e409dbd7ef24b38bf658f7b91c6bac2d110f --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040102_parameters_of_kind_template/Sem_05040102_nested_types_001.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:5.4.1.2, Ensure formal parameters accept nested types. +// @verdict pass accept +module Sem_05040102_nested_types_001 { + +type component GeneralComp {} + +function f(template record of integer n) { + setverdict(pass); +} + +testcase TC_Sem_05040102_nested_types_001() runs on GeneralComp { + f({1, ?, 3}); +} + +control { + execute(TC_Sem_05040102_nested_types_001()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..abab8f1749dbdd6fc2834ec2e7c34bbc7cd5b5ef --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_001.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure variadic formal parameters are at the end of the formal parameter list. +// @verdict pass reject +module NegSem_050403_variadic_parameters_001 { + +function f(in integer i..., in integer max) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d32b3fc888a8361ed22ce403d262d13f697e807a --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_002.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure only one variadic formal parameter per formal parameter list is allowed. +// @verdict pass reject +module NegSem_050403_variadic_parameters_002 { + +function f(in integer a..., in integer b...) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8fe75beff5a49922707af395c436a85aad664a3d --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_003.ttcn @@ -0,0 +1,9 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure variadic parameters are in parameters. +// @verdict pass reject +module NegSem_050403_variadic_parameters_003 { + +function f1(inout integer x...) {} +function f2(out integer x...) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c5f9a653899c8971a57a62f70d1e51597598f805 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_004.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure actual variadic parameter results in an equivalent record of in their declaration order. +// @verdict pass reject +module NegSem_050403_variadic_parameters_004 { + +type record of integer RoI; +type component GeneralComp {} + +function f(in integers... args) return RoI { + return args +} + +testcase TC_NegSem_050403_variadic_parameters_004() runs on GeneralComp { + f(-, -); // Reject: f() has only one variadic parameter to omit. +} + +control { + execute(TC_NegSem_050403_variadic_parameters_004()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3dd69e6a72225992171cb5440a7284e0a51af86 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/NegSem_050403_variadic_parameters_005.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure an actual record of parameter in assignment notation has no additional ellipsis. +// @verdict pass reject +module NegSem_050403_variadic_parameters_005 { + +type component GeneralComp {} + +testcase TC_NegSem_050403_variadic_parameters_005() runs on GeneralComp { + f(args := {1, 2, 3}...); +} + +function f(in integer args...) {} + +control { + execute(TC_NegSem_050403_variadic_parameters_005()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_001.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..73ea8026b17fa36d5dbec1a72f95ed742786249e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_001.ttcn @@ -0,0 +1,10 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure template definitions support variadic formal parameters. +// @verdict pass accept +module Sem_050403_variadic_parameters_001 { + +type record of integer RoI; + +template Roi aRoi(in integer numbers...) := {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_002.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5c849b4dfa63ce1eb8f72c711d9a178df05bb45e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_002.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure function definitions support variadic formal parameters. +// @verdict pass accept +module Sem_050403_variadic_parameters_002 { + +function f(in integer i...) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_003.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6f9d2d9323bc4c12cb103435db3dcca3e984c95 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_003.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure altstep definitions support variadic formal parameters. +// @verdict pass accept +module Sem_050403_variadic_parameters_003 { + +altstep as1(in integer items...) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_004.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..db037072e976231cb86ee12bc0a8b2dc13c1adea --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_004.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure testcase definitions support variadic formal parameters. +// @verdict pass accept, testverdict:pass +module Sem_050403_variadic_parameters_004 { + +type component GeneralComp {} + +testcase TC_Sem_050403_variadic_parameters_004(in verdicttype verdicts...) runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_Sem_050403_variadic_parameters_004()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_005.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8d0c0ed47736a4f3c5afbdfc438f2cd53032f952 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_005.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure variadic formal parameters may have default values. +// @verdict pass accept +module Sem_050403_variadic_parameters_005 { + +function f(in integer i... := {1, 2, 3}) {} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_006.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e3378741b128a614dd842081af2e4d85124ead93 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_006.ttcn @@ -0,0 +1,15 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure variadic parameters are visible as record of types inside the defintion. +// @verdict pass accept +module Sem_050403_variadic_parameters_006 { + +type record of integer RoI; +type record of integer RoA[3]; +type record of C RoC; +type component C {} + +function f1(integer args...) { var RoI r := args } +function f2(integer args[3]...) { var RoA r := args } +function f3(C args[3]...) { var RoC r := args } + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_007.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f682d8c5a7043a48b3f70f7216af5148e517dba --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_007.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure omitted variadic parameter results in an empty record of. +// @verdict pass accept, ttcn3verdict:pass +module Sem_050403_variadic_parameters_007 { + +type component GeneralComp {} + +testcase TC_Sem_050403_variadic_parameters_007() runs on GeneralComp { + + if (len() == 0) { + setverdict(pass); + } else { + setverdict(fail, "len() != 0"); + } +} + +function len(in integer args...) return integer { return lengthof(args) } + +control { + execute(TC_Sem_050403_variadic_parameters_007()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_008.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..52ac6168d17b648cc6118a184a4fd1433e5ba7a1 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_008.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure unused variadic parameter results in an empty record of. +// @verdict pass accept, ttcn3verdict:pass +module Sem_050403_variadic_parameters_008 { + +type component GeneralComp {} + +testcase TC_Sem_050403_variadic_parameters_008() runs on GeneralComp { + + if (len(-) == 0) { + setverdict(pass); + } else { + setverdict(fail, "len() != 0"); + } + +} + +function len(in integer args...) return integer { return lengthof(args) } + +control { + execute(TC_Sem_050403_variadic_parameters_008()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_009.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a9c14c6ae88ee473f60d88dfdaee2ce0a40c5dfa --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_009.ttcn @@ -0,0 +1,37 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure actual variadic parameter results in an equivalent record of in their declaration order. +// @verdict pass accept, ttcn3verdict:pass +module Sem_050403_variadic_parameters_009 { + +type record of integer Roi; +type component GeneralComp {} + +function f(in integer args...) returns RoI { + return args +} + +testcase TC_Sem_050403_variadic_parameters_009() runs on GeneralComp { + if (f() == {}) { + setverdict(pass); + } else { + setverdict(fail, "f() != {}"); + } + + if (f(1) == {1}) { + setverdict(pass); + } else { + setverdict(fail, "f(1) != {1}"); + } + + if (f(1, 2, 3) == {1, 2, 3}) { + setverdict(pass); + } else { + setverdict(fail, "f(1,2,3) != {1,2,3}"); + } +} + +control { + execute(TC_Sem_050403_variadic_parameters_009()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_010.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eb043822f263163d9eb2d8aa887b81bf97275937 --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_010.ttcn @@ -0,0 +1,38 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure an actual record of parameter with ... is passed directly to the formal variadic parameter. +// @verdict pass accept, ttcn3verdict:pass +module Sem_050403_variadic_parameters_010 { + +type record of integer RoI; +type component GeneralComp {} + +function len(in integer args...) return integer { + return lengthof(args); +} + +testcase TC_Sem_050403_variadic_parameters_010() runs on GeneralComp { + if (len({}...) == 0) { + setverdict(pass); + } else { + setverdict(fail, "len({}...) != 0"); + } + + if (len({1, 2, 3}...) == 3) { + setverdict(pass); + } else { + setverdict(fail, "len({1,2,3}...) != 3"); + } + + var RoI r := {1, 2, 3}; + if (len(r...) == 3) { + setverdict(pass); + } else { + setverdict(fail, "len(r...) != 3"); + } +} + +control { + execute(TC_Sem_050403_variadic_parameters_010()); +} + +} diff --git a/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_011.ttcn b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..89e1568dd0161438415ba41d14305adae3da593e --- /dev/null +++ b/ATS/core_language/05_basic_language_elements/0504_parametrization/050403_variadic_parameters/Sem_050403_variadic_parameters_011.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:5.4.3, Ensure an actual record of parameter in assignment notation is passed directly to the formal variadic parameter. +// @verdict pass accept, ttcn3verdict:pass +module Sem_050403_variadic_parameters_011 { + +type component GeneralComp {} + +testcase TC_Sem_050403_variadic_parameters_011() runs on GeneralComp { + if (len(args := {1, 2, 3}) == 3)) { + setverdict(pass); +} else { + setverdict(fail, "len(args := {1, 2, 3}) != 3"); +} +} + +function len(in integer args...) return integer { +return lengthof(args); +} + +control { +execute(TC_Sem_050403_variadic_parameters_011()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f477a3bb982cb916a60b8cca4ced3f0cd13b41a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_001.ttcn @@ -0,0 +1,17 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure the unqualified type name acts as the field name. +// @verdict pass reject +module NegSem_06020104_embedding_fields_001 { + +type record of integer RoI; +type union U { + record of integer RoI; +} + +// Reject nested or anonymous types. +type record R { + Roi[-] + U.Roi +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ddcee9fdd9487716ac795de3efada6c3fb6295bb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/NegSem_06020104_embedding_fields_002.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure embedded fields cannot be used as field names for assignment notations. +// @verdict pass reject +module NegSem_06020104_embedding_fields_002 { + +type component GeneralComp {} + +type record A { + B +} + +type record B { + integer b +} + +const A OK := { B := { b := 1 } } +const A notOK := { b := 1 } + +control { + execute(TC_NegSem_06020104_embedding_fields_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..057bea832e67ab8e62f79fc17f44494a622b3287 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_001.ttcn @@ -0,0 +1,27 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure the unqualified type name acts as the field name. +// @verdict pass accept +module Sem_06020104_embedding_fields_001 { + +type component GeneralComp {} + +type record R { + integer, + R optional, + Sem_06020104_embedding_fields_001.GeneralComp +} + +testcase TC_Sem_06020104_embedding_fields_001() runs on GeneralComp { + var R r := { + integer := 23, + R := {} + } + r.GeneralComp := GeneralComp.create + setverdict(pass) +} + +control { + execute(TC_Sem_06020104_embedding_fields_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_002.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5a70ee2885e15ced6cd28768ccadb4fd73d1b993 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_002.ttcn @@ -0,0 +1,33 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure embedded field is promoted when its name is unique. +// @verdict pass accept, ttcn3verdict:pass +module Sem_06020104_embedding_fields_002 { + +type component GeneralComp {} + +type record A { + B +} + +type record B { + integer b; +} + +testcase TC_Sem_06020104_embedding_fields_002() runs on GeneralComp { + var A a; + + a.b := 1; + a.B.b := 2; + + if (a.b == a.B.b) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_06020104_embedding_fields_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_003.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..208e515d42fbe3854e75c0dba1663f13880962f6 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_003.ttcn @@ -0,0 +1,37 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure embedded field is promoted when its name is unique. +// @verdict pass accept, ttcn3verdict:pass +module Sem_06020104_embedding_fields_003 { + +type component GeneralComp {} + +type record A { + B +} + +type record B { + C +} + +type record C { + integer c +} + +testcase TC_Sem_06020104_embedding_fields_003() runs on GeneralComp { + var A a; + + a.c := 1; + a.B.C.c := 2; + + if (a.c == a.B.C.c) { + setverdict(pass); + } else { + setverdict(fail, "field c not promoted"); + } +} + +control { + execute(TC_Sem_06020104_embedding_fields_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_004.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..338df9baf02229dcbd44960f43a44a0c924323c4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060201_record_type_and_values/06020104_embedding_fields/Sem_06020104_embedding_fields_004.ttcn @@ -0,0 +1,37 @@ +// @author TTF T023 +// @purpose 1:6.2.1.4, Ensure embedded field is not promoted when its name is not unique. +// @verdict pass accept, ttcn3verdict:pass +module Sem_06020104_embedding_fields_004 { + +type component GeneralComp {} + +type record A { + B +} + +type record B { + C, + integer x +} + +type record C { + integer x +} + +testcase TC_Sem_06020104_embedding_fields_004() runs on GeneralComp { + var A a; + a.x := 1; + a.B.x := 2; + a.B.C.x := 3; + if (a.x == a.B.x and a.B.x != a.B.C.x) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_06020104_embedding_fields_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/06020204_embedding_fields/Sem_06020204_embedding_fields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/06020204_embedding_fields/Sem_06020204_embedding_fields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f97b50013eb208e4fe5e19508c4b1facce633701 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060202_set_type_and_values/06020204_embedding_fields/Sem_06020204_embedding_fields_001.ttcn @@ -0,0 +1,10 @@ +// @author TTF T023 +// @purpose 1:6.2.2.4, Ensure set defintion allow embedded fields +// @verdict pass accept +module Sem_06020204_embedding_fields_001 { + +type set S { + integer +} + +} diff --git a/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020504_embedding_fields/Sem_06020504_embedding_fields_001.ttcn b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020504_embedding_fields/Sem_06020504_embedding_fields_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..177e168f72a61a6baa9761933cbdd652a6677db8 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0602_structured_types_and_values/060205_unions/06020504_embedding_fields/Sem_06020504_embedding_fields_001.ttcn @@ -0,0 +1,42 @@ +// @author TTF T023 +// @purpose 1:6.2.5.4, Ensure union defintions allow embedded fields and handle promotion correctly. +// @verdict pass accept, ttcn3verdict:pass +module Sem_06020504_embedding_fields_001 { + +type component GeneralComp {} + +type union Anytype { + integer, + boolean, + R +} + +type record R { + integer, + verdicttype +} + +testcase TC_Sem_06020504_embedding_fields_001() runs on GeneralComp { + + var Anytype a := { boolean := false }; + + a.verdicttype := pass; // Equivalent to a.R.verdicttype := pass; + if (ischosen(a.R)) { + setverdict(pass) + } else { + setverdict(fail, "a.R is not chosen") + } + + a.integer := 1; // Not equivalent to a.R.integer := 1; + if (ischosen(a.integer)) { + setverdict(pass) + } else { + setverdict(fail, "a.integer is not chosen") + } +} + +control { + execute(TC_Sem_06020504_embedding_fields_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..81e0df49928136206ea912c9595c245d63d22e16 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_001.ttcn @@ -0,0 +1,10 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure ArrayDef part is omitted for variables with automatic type inference. +// @verdict pass reject +module NegSem_0605_automatic_type_001 { + +function f() { + var x[2] := {1, 2}; +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5960344bfa491efd067b52332f4f2e020637265c --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_002.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure ArrayDef part is omitted for constants with automatic type inference. +// @verdict pass reject +module NegSem_0605_automatic_type_002 { + +const IP[4] := { 192, 168, 0, 1 }; + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..565fab3d6091cb58378b670f2697616a6b291064 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_automatic_type_003.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure ambiguous types are rejected. +// @verdict pass reject +module NegSem_0605_automatic_type_003 { + +const X := null; + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_expressions_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_expressions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f8cefed580affb6ccc5205aed46f5ad0887c4417 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_expressions_001.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure qualified enumerated values. +// @verdict pass reject +module NegSem_0605_expressions_001 { + +type component GeneralComp {} + +type enumerated E { A(1), B(2) } + +testcase TC_NegSem_0605_expressions_001() runs on GeneralComp { + var e := A; +} + +control { + execute(TC_NegSem_0605_expressions_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_index_lists_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_index_lists_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b76bdd25405f1d43cdc7204dbb83ed6e78f944eb --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_index_lists_001.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure index list with common key type keys is a map. +// @verdict pass reject +module NegSem_0605_index_lists_001 { + +type component GeneralComp {} + +testcase TC_NegSem_0605_index_lists_001() runs on GeneralComp { + var v := { ["Hello"] := 1, [1] := 2 }; +} + +control { + execute(TC_NegSem_0605_index_lists_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5b0ad4ce005825a9ee8d76d22d2d7c8cd182ee0e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_001.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for *. +// @verdict pass reject +module NegSem_0605_literals_001 { + +modulepar template mpar := *; + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f02061de5ca967ff13e4a3f547e00dfae5d206c7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_literals_002.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for ?. +// @verdict pass reject +module NegSem_0605_literals_002 { + +modulepar template mpar := ? + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_references_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_references_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7aa61f2e2224e528ac60356923525a19837a4aff --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/NegSem_0605_references_001.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for templates. +// @verdict pass reject +module NegSem_0605_references_001 { + +type component GeneralComp {} + +template integer t_int := ?; + +testcase TC_NegSem_0605_references_001() runs on GeneralComp { + var v := t_int; // error: v must be declared as template explicitly. +} + +control { + execute(TC_NegSem_0605_references_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..befc6e51db101c559362e5518a3671dd517c56aa --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_001.ttcn @@ -0,0 +1,10 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure variables provide automatic type inference. +// @verdict pass accept +module Sem_0605_automatic_type_001 { + +function f() { + var x := 1; +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2146a2a481adaa3b1aacc9aa46f2aad82b4a582b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_002.ttcn @@ -0,0 +1,11 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure template variables provide automatic type inference. +// @verdict pass accept +module Sem_0605_automatic_type_002 { + +function f() { + var template t1 := 1; + var omit t2 := 2; +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..85067f8055b13444076e4661ca76cfe0c98a7334 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_003.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure constants provide automatic type inference. +// @verdict pass accept +module Sem_0605_automatic_type_003 { + +const X := 23; + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_004.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b77892a03579b4ebfbb254b0acbffc7162af2df1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_004.ttcn @@ -0,0 +1,10 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure fuzzy variables provide automatic type inference. +// @verdict pass accept +module Sem_0605_automatic_type_004 { + +function f() { + var @fuzzy x := 1; +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_005.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..44a8817731a9f73b1c32347ff7aeb662655e44ff --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_automatic_type_005.ttcn @@ -0,0 +1,8 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure module parameter provide automatic type inference. +// @verdict pass accept +module Sem_0605_automatic_type_005 { + +modulepar mpar := 1; + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0613210117e6ba03e0f0b80b88db20b7e6b9fd38 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_001.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for expressions. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_expressions_001 { + +type component GeneralComp {} + +testcase TC_Sem_0605_expressions_001() runs on GeneralComp { + var cond := 1 + 2 <= 3; + if (cond == true) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_expressions_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2629a4fb4687727b2889e56b50018d0249024aa1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_002.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure qualified enumerated values. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_expressions_002 { + +type component GeneralComp {} + +type enumerated E { A(1), B(2) } +type enumerated F { B(3), C(4) } + +testcase TC_Sem_0605_expressions_002() runs on GeneralComp { + var v := F.B; + if (enum2int(v) == 3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_expressions_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8444057267b015c7367458baaf3d7105151192e0 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_003.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for value ranges. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_expressions_003 { + +type component GeneralComp {} + +testcase TC_Sem_0605_expressions_003() runs on GeneralComp { + var v := (0.1..!0.2); + if (match(0.11, v)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_expressions_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_004.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..eabe4a8db56e7c416ecf41416482f10834b805d9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_expressions_004.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure infinity bounds are inferred to integer. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_expressions_004 { + +type component GeneralComp {} + +testcase TC_Sem_0605_expressions_004() runs on GeneralComp { + var v := (-infinity..infinity); + if (match(7, v)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_expressions_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4b50c6206c310277f84d8a3d8a6e50efd6cd749b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_001.ttcn @@ -0,0 +1,26 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure record fields have the same order as specified. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_field_assignment_lists_001 { + +type component GeneralComp {} + +type record Point { + integer x, + integer y +} + +testcase TC_Sem_0605_field_assignment_lists_001() runs on GeneralComp { + var v := { x := 1, y := 2 } + if (match(v, Point:{x := 1, y := 2})) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_field_assignment_lists_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..74b8f86490701bdf1107afaaa1918893c031e9a3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_002.ttcn @@ -0,0 +1,26 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure record fields become optional as specified (15.8). +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_field_assignment_lists_002 { + +type component GeneralComp {} + +type record Point { + integer x, + integer y optional +} + +testcase TC_Sem_0605_field_assignment_lists_002() runs on GeneralComp { + var v := { x := 1, y := omit } + if (match(v, { x := 1, y := omit })) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_field_assignment_lists_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aa4917b5359b521c4e6d8fc301ede31cb4fe27f7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_field_assignment_lists_003.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure field assignment lists are anonymous records. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_field_assignment_lists_003 { + +type component GeneralComp {} + +function verifyType(inout record { integer x, integer y } r) { + setverdict(pass); +} + +testcase TC_Sem_0605_field_assignment_lists_003() runs on GeneralComp { + var v := { x := 1, y := 2 }; + verifyType(v); +} + +control { + execute(TC_Sem_0605_field_assignment_lists_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b88cebe0789e7d051367c115004a0f09ecd7a7ca --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_001.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure index list with integer key type is a record of. +// @verdict pass accept +module Sem_0605_index_lists_001 { + +type component GeneralComp {} + +type record of universal charstring RoUC; + +testcase TC_Sem_0605_index_lists_001() runs on GeneralComp { + var v := { [1] := "Hello", [3] := -, [5] := "Wörld" }; + var RoUC r := v; +} + +control { + execute(TC_Sem_0605_index_lists_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..aecfb7a7c8e345b920c889f0b1280400128c9b46 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_002.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure index list with common key type keys is a map. +// @verdict pass accept +module Sem_0605_index_lists_002 { + +type component GeneralComp {} + +type map from float to charstring M; + +testcase TC_Sem_0605_index_lists_002() runs on GeneralComp { + var v := { [1.0] := "a", [2.1] := "b" }; + var M m := v; +} + +control { + execute(TC_Sem_0605_index_lists_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0e924f4b04a233574b8cb70373eff70b59368993 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_index_lists_003.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure index list with common key type keys is a map. +// @verdict pass accept +module Sem_0605_index_lists_003 { + +type component GeneralComp {} + +type map from universal charstring to integer M; + +testcase TC_Sem_0605_index_lists_003() runs on GeneralComp { + var v := { ["Hello"] := 5, ["Wörld"] := 23 }; + var M m := v; +} + +control { + execute(TC_Sem_0605_index_lists_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d2169c60bdf34c22523e41448f55a1c782f1133d --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_001.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for integer literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_001 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout integer i) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_001() runs on GeneralComp { + { var v := -1; verifyType(i) } + { var v := 0; verifyType(i) } + { var v := 2; verifyType(i) } +} + +control { + execute(TC_Sem_0605_literals_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a503100265bfc7c09e7596fb2851c7cf821a2bf4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_002.ttcn @@ -0,0 +1,25 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for verdicttype literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_002 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout verdicttype v) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_002() runs on GeneralComp { + { var v := none; verifyType(v); } + { var v := pass; verifyType(v); } + { var v := inconc; verifyType(v); } + { var v := fail; verifyType(v); } + { var v := error; verifyType(v); } +} + +control { + execute(TC_Sem_0605_literals_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..531d7ad51873e1169548c3c105235e2b62d3c2e4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_003.ttcn @@ -0,0 +1,25 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for float literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_003 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout float f) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_003() runs on GeneralComp { + { var v := -1.0; verifyType(v) } + { var v := not_a_number; verifyType(v) } + { var v := -infinity; verifyType(v) } + { var v := infinity; verifyType(v) } + { var v := 0.3; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_004.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7d27a67b7d8176fbf2a488156470edf8efe3962 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_004.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for bitstring literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_004 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout bitstring bs) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_004() runs on GeneralComp { + { var v := '1'B; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_005.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e52c4b4ed6353080a1ce7f88d1d11eb42e3c833f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_005.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for hexstring literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_005 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout hexstring hs) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_005() runs on GeneralComp { + { var v := '5'H; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_006.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..10ac407634f248f36d12cb288b645eddb14834e4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_006.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for octetstring literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_006 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout octetstring os) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_006() runs on GeneralComp { + { var v := '03'O; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_007.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a8502af75637baa37ea0156150518ee823fb440 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_007.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for charstring literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_007 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout charstring cs) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_007() runs on GeneralComp { + { var v := ""; verifyType(v) } + { var v := "abc"; verifyType(v) } + { var v := __MODULE__; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_008.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c6eea7415a3c97b17920ffc9f6b986ec060823f1 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_008.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for universal charstring literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_008 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout universal charstring us) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_008() runs on GeneralComp { + { var v := "Wörld"; verifyType(v); } +} + +control { + execute(TC_Sem_0605_literals_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_009.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a6ac52ff70b28e95eae3bb80ace08bfc6b8b8cc3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_literals_009.ttcn @@ -0,0 +1,22 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for boolean literals. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_literals_009 { + +type component GeneralComp {} + +// inout parameters require strong typing and can be used to type verification. +function verifyType(inout boolean b) { + setverdict(pass); +} + +testcase TC_Sem_0605_literals_009() runs on GeneralComp { + { var v := true; verifyType(v) } + { var v := false; verifyType(v) } +} + +control { + execute(TC_Sem_0605_literals_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30d24475eceb3f89a0e29e0f783a9e599e09fbd7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_001.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for variables. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_001 { + +type component GeneralComp {} + +type integer int; + +function verifyType(inout int i) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_001() runs on GeneralComp { + var int i := 1; + var v := i; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..632ec8e3b6f4d5fd1d960fccdf5a51ad03022230 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_002.ttcn @@ -0,0 +1,22 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for arrays. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_002 { + +type component GeneralComp {} + +function verifyType(inout integer a[3]) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_002() runs on GeneralComp { + var integer a[3]; + var v := a; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..21e818caa6bcf7ca1da515df8341f2f3068557b5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_003.ttcn @@ -0,0 +1,26 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for lazy variables. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_003 { + +type component GeneralComp {} + +function verifyType(inout universal charstring uc) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_003() runs on GeneralComp { + var @lazy v1 := "üniversal charstrüng"; + { + var charstring v2 := "charstring"; + v1 := v2; + } + var v3 := v1; + verifyType(v3); +} + +control { + execute(TC_Sem_0605_references_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_004.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ab5b003e723f979490b2a46eac3c1657c0ed2ce4 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_004.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for module parameter references. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_004 { + +type component GeneralComp {} + +modulepar integer mp := 2; + +testcase TC_Sem_0605_references_004() runs on GeneralComp { + var i := mp; + i := i + 1; + if (i == 3) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_references_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_005.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a313bd5953ec0c34d3ce5a28f43502124cb2afb9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_005.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for templates. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_005 { + +type component GeneralComp {} + +template integer t_int := ? + +testcase TC_Sem_0605_references_005() runs on GeneralComp { + var template v := t_int; + if (match(1, v)) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_references_005()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_006.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9484115f922c8bdfe105308a01ccbd0f14323b43 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_006.ttcn @@ -0,0 +1,22 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for modified templates. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_006 { + +type component GeneralComp {} + +function verifyType(inout template integer ti) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_006() runs on GeneralComp { + var template integer t1 := ?; + var template v := modifies t1 := 2; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_006()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_007.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8c982727b7f8bbec15a0870ad88149235ad5facc --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_007.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for components. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_007 { + +type component GeneralComp {} + +verifyType(inout GeneralComp c) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_007() runs on GeneralComp { + var c := mtc; + verifyType(c); +} + +control { + execute(TC_Sem_0605_references_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_008.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..8a2a88936bfd857a63a7304553e48d891eb28fc5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_008.ttcn @@ -0,0 +1,25 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for ports. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_008 { + +type component GeneralComp { + port Port p; +} + +type port Port message { inout integer } + +verifyType(inout Port p) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_008() runs on GeneralComp { + var v := p; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_009.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..327248a28e1dbea734a50f6cbf91354586975eb3 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_009.ttcn @@ -0,0 +1,11 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for timer. +// @verdict pass accept +module Sem_0605_references_009 { + +type component GeneralComp { + timer t; + var v := t; +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_010.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b40dd02b5ca94a9558e81cfa98a6333d21a83e92 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_010.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for constants. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_010 { + +const integer I := 1; + +type component GeneralComp {} + +testcase TC_Sem_0605_references_010() runs on GeneralComp { + var i := I; + i := i + 1; + if (i == 2) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_references_010()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_011.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_011.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2b60b69066767327f213443738bcd2381980a26b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_011.ttcn @@ -0,0 +1,25 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for parameters. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_011 { + +type component GeneralComp {} + +function verifyType(inout integer i) { + setverdict(pass); +} + +function f(integer i) returns integer { + var j := i; + verifyType(j); +} + +testcase TC_Sem_0605_references_011() runs on GeneralComp { + f(1); +} + +control { + execute(TC_Sem_0605_references_011()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_012.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_012.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3211609a4e52f64e21147aa7ae0c780b9c9bc47b --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_012.ttcn @@ -0,0 +1,26 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for field references. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_012 { + +type component GeneralComp {} + +type record R { + record { integer i, float f, } nr; +} + +function verifyType(inout R.nr nr) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_012() runs on GeneralComp { + var R r := { nr := { i := 1, f := 1.0 } }; + var v := r.nr; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_012()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_013.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_013.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..f3c8c18c5ade4ae123d57687342b5a94d2740e8a --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_013.ttcn @@ -0,0 +1,27 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for references to unions; +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_013 { + +type component GeneralComp {} + +type union U { + universal charstring ucs, + integer i, +} + +function verifyType(inout U u) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_013() runs on GeneralComp { + var U u := { i := 1 }; + var v := u; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_013()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_014.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_014.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d7a800afafd0da366787c5837370c18fb2f0692e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_references_014.ttcn @@ -0,0 +1,27 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for references to union default variants. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_references_014 { + +type component GeneralComp {} + +type union U { + @default universal charstring ucs, + integer i +} + +function verifyType(inout U u) { + setverdict(pass); +} + +testcase TC_Sem_0605_references_014() runs on GeneralComp { + var U u := "hello"; + var v := u; + verifyType(v); +} + +control { + execute(TC_Sem_0605_references_014()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..3c5511b16d729fa4c97201850797e097122a8f5f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_001.ttcn @@ -0,0 +1,25 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for user defined functions. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_001 { + +type component GeneralComp {} + +type integer Alias; + +function f() return Alias { return 1; } + +function verifyType(inout Alias a) { + setverdict(pass); +} + +testcase TC_Sem_0605_return_values_001() runs on GeneralComp { + var v := f(); + verifyType(v); +} + +control { + execute(TC_Sem_0605_return_values_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e4ab5b75744714c80bc1b0a2cc49da165236e14e --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_002.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for substr. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_002 { + +type component GeneralComp {} + +function verifyType(inout bitstring bs) { + setverdict(pass); +} + +testcase TC_Sem_0605_return_values_002() runs on GeneralComp { + var v := substr('00100110'B, 3, 4); + verifyType(v); +} + +control { + execute(TC_Sem_0605_return_values_002()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_003.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b8cb1aae3a0ca164bfbb73ad621d0caa3a0717c9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_003.ttcn @@ -0,0 +1,24 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for valueof. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_003 { + +type component GeneralComp {} + +type integer Alias; +template Alias t := 1; + +function verifyType(inout Alias a) { + setverdict(pass); +} + +testcase TC_Sem_0605_return_values_003() runs on GeneralComp { + var v := valueof(t); + verifyType(v); +} + +control { + execute(TC_Sem_0605_return_values_003()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_004.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..4f389b4f083efbaa5fa8a93008936d9ea44142d5 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_004.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for ischosen. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_004 { + +type component GeneralComp {} + +testcase TC_Sem_0605_return_values_004() runs on GeneralComp { + var anytype a := { integer := 23 }; + var v := ischosen(a.integer); + if (v) { + setverdict(pass); + } +} + +control { + execute(TC_Sem_0605_return_values_004()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_005.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..98d10fe14b0840d36a66c09c97e6daf5fd4132c7 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_005.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for match. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_005 { + +type component GeneralComp {} + +testcase TC_Sem_0605_return_values_005() runs on GeneralComp { + var v := match(23, integer:(); + if (v) { + setverdict(pass); + } + } + + control { + execute(TC_Sem_0605_return_values_005()); + } + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_006.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6c7c12486736058119feed138f5bac1f5da4a966 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_006.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for execute. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_006 { + +type component GeneralComp {} + +testcase TC_Sem_0605_return_values_006(inout verdicttype v) runs on GeneralComp { + setverdict(v); +} + +testcase TC_Sem_0605_return_values_006_dummy() runs on GeneralComp { + setverdict(pass); +} + +control { + var v := execute(TC_Sem_0605_return_values_006_dummy()); + execute(TC_Sem_0605_return_values_006(v)); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_007.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b45603ee2e4213f127e127ed5e1b6c53c0d2985f --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_007.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for create. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_007 { + +type component GeneralComp {} + +function f() runs on GeneralComp {} + +testcase TC_Sem_0605_return_values_007() runs on GeneralComp { + var c := GeneralComp.create; + c.start(f()); + c.done; + setverdict(pass); +} + +control { + execute(TC_Sem_0605_return_values_007()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_008.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..cba9cc11807d7e5966d5b45cccdfcd5890235bd9 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_008.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for patterns. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_008 { + +type component GeneralComp {} + +function verifyType(inout template charstring cs) { + setpass(pass) +} + +testcase TC_Sem_0605_return_values_008() runs on GeneralComp { + var v := pattern "a*"; + verifyType(v) +} + +control { + execute(TC_Sem_0605_return_values_008()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_009.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_009.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..9a928c689751a5ce8bc6d8ec90d7603a817ee9fd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_009.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for extension. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_009 { + +type component GeneralComp {} + +type integer int with { extension "ext" } +type record of universal charstring RoS; + +testcase TC_Sem_0605_return_values_009() runs on GeneralComp { + var v := int.extension; + var Ros expected := { "ext" }; + if (v == expected) { + setverdict(pass); + } +} + +control { + execute(TC_Sem_0605_return_values_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_010.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_010.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7c7d2a57ee92586d8d3e67958286b9c74075accd --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_return_values_010.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure automatic type for activate. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_return_values_009 { + +type component GeneralComp {} + +altstep as() {} + +testcase TC_Sem_0605_return_values_009() runs on GeneralComp { + var v := activate(as()); + deactivate(v); +} + +control { + execute(TC_Sem_0605_return_values_009()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_001.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a164f6d1b829309aed0043576b7f22aa35179c23 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_001.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure common type of value lists is inferred. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_value_lists_001 { + +type component GeneralComp {} + +testcase TC_Sem_0605_value_lists_001() runs on GeneralComp { + var a := 1; + var b := {a, 2}; + var c := {{}, b, {3}}; + if (match(c, {{}, {1, 2}, {3}})) { + setverdict(pass); + } else { + setverdict(fail); + } +} + +control { + execute(TC_Sem_0605_value_lists_001()); +} + +} diff --git a/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_002.ttcn b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b744668e1d7e40717f7762b72f449da0f33a7be2 --- /dev/null +++ b/ATS/core_language/06_types_and_values/0605_automatic_type/Sem_0605_value_lists_002.ttcn @@ -0,0 +1,21 @@ +// @author TTF T023 +// @purpose 1:6.5, Ensure common type of value lists is inferred. +// @verdict pass accept, ttcn3verdict:pass +module Sem_0605_value_lists_002 { + +type component GeneralComp {} + +function verifyType(inout universal charstring v) { + setverdict(pass); +} + +testcase TC_Sem_0605_value_lists_002() runs on GeneralComp { + var v := { "Hello", "Wörld" }; + verifyType(v); +} + +control { + execute(TC_Sem_0605_value_lists_002()); +} + +} diff --git a/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_nested_types_001.ttcn b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..30ed01265bf24fe7230e823ec07d4c44080ef8f0 --- /dev/null +++ b/ATS/core_language/08_modules/0802_module_definitions_part/080201_module_parameters/Sem_080201_nested_types_001.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:8.2.1, Ensure module parameters accept nested types. +// @verdict pass accept +module Sem_080201_nested_types_001 { + +modulepar record of charstring IDs := {1, 2, 3}; + +type component GeneralComp {} + +testcase TC_Sem_080201_nested_types_001() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_Sem_080201_nested_types_001()); +} + +} diff --git a/ATS/core_language/10_constants/Sem_10_nested_types_001.ttcn b/ATS/core_language/10_constants/Sem_10_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..6ad3a3e09d615247ede341392b2aef5381c86689 --- /dev/null +++ b/ATS/core_language/10_constants/Sem_10_nested_types_001.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:10, Ensure constants accept nested types. +// @verdict pass accept +module Sem_10_nested_types_001 { + +const record of integer := { 1, 2, 3 }; + +type component GeneralComp {} + +testcase TC_Sem_10_nested_types_001() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_Sem_10_nested_types_001()); +} + +} diff --git a/ATS/core_language/11_variables/Sem_11_nested_types_001.ttcn b/ATS/core_language/11_variables/Sem_11_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..0032fe8a042401dd158cc9be2a7ccb856399c48e --- /dev/null +++ b/ATS/core_language/11_variables/Sem_11_nested_types_001.ttcn @@ -0,0 +1,17 @@ +// @author TTF T023 +// @purpose 1:11, Ensure variables accept nested types. +// @verdict pass accept +module Sem_11_nested_types_001 { + +type component GeneralComp {} + +testcase TC_Sem_11_nested_types_001() runs on GeneralComp { + var template record of integer t := {1, *, 3}; + var record {} v[3]; +} + +control { + execute(TC_Sem_11_nested_types_001()); +} + +} diff --git a/ATS/core_language/14_procedure_signatures/Sem_14_nested_types_001.ttcn b/ATS/core_language/14_procedure_signatures/Sem_14_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..e2945813a5228b88839833a49f3f697610f8d38a --- /dev/null +++ b/ATS/core_language/14_procedure_signatures/Sem_14_nested_types_001.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:14, Ensure signatures accept nested types. +// @verdict pass accept +module Sem_14_nested_types_001 { + +type component GeneralComp {} + +signature A() return record of integer; +signature B(record of integer p); +signature C() exception (record {}); + +testcase TC_Sem_14_nested_types_001() runs on GeneralComp { + setverdict(pass); +} + +control { + execute(TC_Sem_14_nested_types_001()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_000.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_000.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7f6698e5331ad7974af1d820b48c013e0c1cb6ed --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_000.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure optional parameter is universal charstring +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_000 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_000() runs on GeneralComp { + ???("Hello " & ???); +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_000()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..953f4cd231d8b00d654b801d7726e66f733a6dff --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_001.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as value in local expressions +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_001 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_001() runs on GeneralComp { + var integer i := ???; +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_001()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..675d656dc6b15c887388de4dd3b0dfbfd05a5eed --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_002.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as value in any expressions +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_002 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_002() runs on GeneralComp { + var integer i := -???; +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_002()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..ac55d18beebd5d77dc6ff39e836de12c9cee91f3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_003.ttcn @@ -0,0 +1,18 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as value in module parameters +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_003 { + +modulepar charstring reason := ???; + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_003() runs on GeneralComp { + setverdict(pass, reason); +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_003()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..2fbddd5dd20aaab258c5af4e2051f83b4a0dd05d --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_004.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as value as default parameter +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_004 { + +type component GeneralComp {} + +function isNeg(in integer i := ???) boolean { + return i < 0; +} + +testcase TC_NegSem_160106_the_not_implemented_function_004() runs on GeneralComp { + // Will have error verdict, because default parameter of isNeg contains ???. + if (isNeg()) { + setverdict(pass); + } +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_004()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a524f78387567e90c880341db42a2f9b69d4c5d3 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_005.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as stand-alone statement (direct use) +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_005 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_005() runs on GeneralComp { + ??? +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_005()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_006.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_006.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c87d4a73cac751cb1772f7107c2c69560edaf749 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_006.ttcn @@ -0,0 +1,17 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure optional parameter is universal charstring +// @verdict pass reject +module NegSem_160106_the_not_implemented_function_006 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_006() runs on GeneralComp { + var integer i := 5; + ???(i); +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_006()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_007.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_007.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..a17ff4227bbee3cf733bd3a7a951ac3a50c9e345 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_007.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure optional parameter is universal charstring +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_007 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_007() runs on GeneralComp { + ???("charstring is compatible with universal charstring"); +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_007()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_008.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_008.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..deb497ecb2db898c6af984cbb2088ca3ea2ab075 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/NegSem_160106_the_not_implemented_function_008.ttcn @@ -0,0 +1,16 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure optional parameter is universal charstring +// @verdict pass accept, ttcn3verdict:error +module NegSem_160106_the_not_implemented_function_008 { + +type component GeneralComp {} + +testcase TC_NegSem_160106_the_not_implemented_function_008() runs on GeneralComp { + ???("Hello wörld!"); +} + +control { + execute(TC_NegSem_160106_the_not_implemented_function_008()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..485bf883d3b0e0d1538c8728f9795f294cecafe5 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_001.ttcn @@ -0,0 +1,23 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as value as default parameter +// @verdict pass accept, ttcn3verdict:pass +module Sem_160106_the_not_implemented_function_001 { + +type component GeneralComp {} + +function isNeg(in integer i := ???) boolean { + return i < 0; +} + +testcase TC_Sem_160106_the_not_implemented_function_001() runs on GeneralComp { + // No error because default parameter is not evaluated. + if (isNeg(-5)) { + setverdict(pass); + } +} + +control { + execute(TC_Sem_160106_the_not_implemented_function_001()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_002.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_002.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..b2a46c29349e9ad69c517dd136d3b6ccb04a6de2 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_002.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? can be used as stand-alone statement (direct use) +// @verdict pass accept, ttcn3verdict:pass +module Sem_160106_the_not_implemented_function_002 { + +type component GeneralComp {} + +testcase TC_Sem_160106_the_not_implemented_function_002() runs on GeneralComp { + if (false) { + ??? + } + setverdict(pass); +} + +control { + execute(TC_Sem_160106_the_not_implemented_function_002()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_003.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_003.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..d1127db541de4173a09710b5fcb049de9dfb2baf --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_003.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure ??? allows optional parameter +// @verdict pass accept, ttcn3verdict:pass +module Sem_160106_the_not_implemented_function_003 { + +type component GeneralComp {} + +testcase TC_Sem_160106_the_not_implemented_function_003() runs on GeneralComp { + if (false) { + var universal charstring s := "abc"; + ???(s); + } + setverdict(pass); +} + +control { + execute(TC_Sem_160106_the_not_implemented_function_003()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_004.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_004.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..dbf5bb8557b3b70ca717640bf8dcb783072d9460 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_004.ttcn @@ -0,0 +1,19 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure optional parameter is universal charstring +// @verdict pass accept, ttcn3verdict:pass +module Sem_160106_the_not_implemented_function_004 { + +type component GeneralComp {} + +testcase TC_Sem_160106_the_not_implemented_function_004() runs on GeneralComp { + if (false) { + ???("Hello " & ???); + } + setverdict(pass); +} + +control { + execute(TC_Sem_160106_the_not_implemented_function_004()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_005.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_005.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..7dd347c257823f66a386222fd327691663e4eae0 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/160106_the_not_implemented_function/Sem_160106_the_not_implemented_function_005.ttcn @@ -0,0 +1,26 @@ +// @author TTF T023 +// @purpose 1:16.1.6, Ensure implementation does not change during tests execution +// @verdict pass accept, ttcn3verdict:pass +module Sem_160106_the_not_implemented_function_005 { + +type component GeneralComp {} + +function @deterministic f() return charstring { + return ???; +} + +testcase TC_Sem_160106_the_not_implemented_function_005() runs on GeneralComp { + var charstring x := f(); + var charstring y := f(); + if (x == y) { + setverdict(pass); + } else { + setverdict(fail, x & " != " & y); + } +} + +control { + execute(TC_Sem_160106_the_not_implemented_function_005()); +} + +} diff --git a/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_nested_types_001.ttcn b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_nested_types_001.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..fc8edc0030b9356f14282014ed690d83adf65fa6 --- /dev/null +++ b/ATS/core_language/16_functions_altsteps_testcases/1601_functions/1601_toplevel/Sem_1601_nested_types_001.ttcn @@ -0,0 +1,20 @@ +// @author TTF T023 +// @purpose 1:16.1.0, Ensure functions accept nested return types. +// @verdict pass accept +module Sem_1601_nested_types_001 { + +type component GeneralComp {} + +function f() returns record of record {}[3] { + setverdict(pass); +} + +testcase TC_Sem_1601_nested_types_001() runs on GeneralComp { + f(); +} + +control { + execute(TC_Sem_1601_nested_types_001()); +} + +}